Skip to content

Commit c29177f

Browse files
committed
test for partial bind-name
1 parent c90f213 commit c29177f

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/deprecations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ if (process.env.NODE_ENV !== 'production') {
159159
},
160160

161161
PARTIAL_NAME: function (id) {
162-
wanr(
162+
warn(
163163
'<partial name="' + id + '">: mustache interpolations inside attributes ' +
164164
'will be deprecated in 1.0.0. Use bind-name="expression" instead.'
165165
)

test/unit/specs/element-directives/partial_spec.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,26 @@ describe('Partial', function () {
4848
})
4949
})
5050

51+
it('dynamic (new syntax)', function (done) {
52+
var vm = new Vue({
53+
el: el,
54+
template: '<partial bind-name="\'test-\' + id"></partial>',
55+
data: {
56+
id: 'a'
57+
},
58+
partials: {
59+
'test-a': 'a {{id}}',
60+
'test-b': 'b {{id}}'
61+
}
62+
})
63+
expect(el.textContent).toBe('a a')
64+
vm.id = 'b'
65+
_.nextTick(function () {
66+
expect(el.textContent).toBe('b b')
67+
done()
68+
})
69+
})
70+
5171
it('caching', function () {
5272
var calls = 0
5373
var compile = compiler.compile

0 commit comments

Comments
 (0)