Skip to content

Commit 0f22166

Browse files
kili-ilochrisvfritz
authored andcommitted
Fix a warning and a bad reference in the "Components - Dynamic Components" example (volksbright#409)
* Mount "Dynamic Components" VM to #example instead of body http://rc.vuejs.org/guide/components.html#Dynamic-Components Mounting a VM to the body produces the following warning: `vue.js:2532 [Vue warn]: Do not mount Vue to <html> or <body> - mount to normal elements instead.` * Save "Dynamic Components" VM as a `vm` to match later reference http://rc.vuejs.org/guide/components.html#Dynamic-Components The HTML snippet references the VM as `vm`, but the VM is not currently saved as a variable.
1 parent b42fc9c commit 0f22166

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/guide/components.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -807,8 +807,8 @@ The content distribution API is a very useful mechanism when designing component
807807
You can use the same mount point and dynamically switch between multiple components using the reserved `<component>` element and dynamically bind to its `is` attribute:
808808

809809
``` js
810-
new Vue({
811-
el: 'body',
810+
var vm = new Vue({
811+
el: '#example',
812812
data: {
813813
currentView: 'home'
814814
},
@@ -833,8 +833,8 @@ var Home = {
833833
template: '<p>Welcome home!</p>'
834834
}
835835

836-
new Vue({
837-
el: 'body',
836+
var vm = new Vue({
837+
el: '#example',
838838
data: {
839839
currentView: Home
840840
}

0 commit comments

Comments
 (0)