diff --git a/compiler/generate/index.js b/compiler/generate/index.js index 347d7062cf..cf2e17bbf7 100644 --- a/compiler/generate/index.js +++ b/compiler/generate/index.js @@ -101,7 +101,7 @@ export default function generate ( parsed, source, options ) { const context = indexes[ name ]; if ( !~usedContexts.indexOf( context ) ) usedContexts.push( context ); } else { - dependencies.push( node.name ); + dependencies.push( name ); generator.code.prependRight( node.start, `root.` ); if ( !~usedContexts.indexOf( 'root' ) ) usedContexts.push( 'root' ); } diff --git a/test/compiler/component-data-dynamic/Widget.html b/test/compiler/component-data-dynamic/Widget.html index 5886087d16..43184b9ad8 100644 --- a/test/compiler/component-data-dynamic/Widget.html +++ b/test/compiler/component-data-dynamic/Widget.html @@ -1,3 +1,4 @@
foo: {{foo}}
baz: {{baz}} ({{typeof baz}})
qux: {{qux}}
+quux: {{quux}}
diff --git a/test/compiler/component-data-dynamic/_config.js b/test/compiler/component-data-dynamic/_config.js index 514faf667e..48c8fff2bf 100644 --- a/test/compiler/component-data-dynamic/_config.js +++ b/test/compiler/component-data-dynamic/_config.js @@ -2,16 +2,18 @@ export default { data: { bar: 'lol', x: 2, - compound: 'piece of' + compound: 'piece of', + go: { deeper: 'core' } }, - html: `foo: lol
\nbaz: 42 (number)
\nqux: this is a piece of string
foo: lol
\nbaz: 42 (number)
\nqux: this is a piece of string
\nquux: core
foo: wut
\nbaz: 43 (number)
\nqux: this is a rather boring string
foo: wut
\nbaz: 43 (number)
\nqux: this is a rather boring string
\nquux: heart