Skip to content

Commit

Permalink
fix v-repeat + custom element component
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Dec 2, 2014
1 parent fe35b51 commit 537fcf7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/directives/repeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ module.exports = {
$parent: this.vm
})
this.template = transclude(this.template, merged)
this._linkFn = compile(this.template, merged)
this._linkFn = compile(this.template, merged, false, true)
}
} else {
// to be resolved later
Expand Down
17 changes: 17 additions & 0 deletions test/unit/specs/directives/repeat_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,23 @@ if (_.inBrowser) {
expect(el.innerHTML).toBe('<p>0 1</p><p>1 2</p><p>2 3</p><!--v-repeat-->')
})

it('custom element component', function () {
var vm = new Vue({
el: el,
data: {
items: [{a:1}, {a:2}, {a:3}]
},
template: '<test-component v-repeat="items"></test-component>',
components: {
'test-component': {
template: '<p>{{$index}} {{a}}</p>',
replace: true
}
}
})
expect(el.innerHTML).toBe('<p>0 1</p><p>1 2</p><p>2 3</p><!--v-repeat-->')
})

it('nested repeats', function () {
var vm = new Vue({
el: el,
Expand Down

0 comments on commit 537fcf7

Please sign in to comment.