Skip to content

Commit 2561376

Browse files
committed
use modifier syntax for prop binding types
1 parent 334dda1 commit 2561376

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/compiler/compile-props.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ module.exports = function compileProps (el, propOptions) {
104104
} else {
105105
// new syntax, check binding type
106106
if ((value = _.getBindAttr(el, attr)) === null) {
107-
if ((value = _.getBindAttr(el, attr + '&')) !== null) {
107+
if ((value = _.getBindAttr(el, attr + '.sync')) !== null) {
108108
prop.mode = propBindingModes.TWO_WAY
109-
} else if ((value = _.getBindAttr(el, attr + '*')) !== null) {
109+
} else if ((value = _.getBindAttr(el, attr + '.once')) !== null) {
110110
prop.mode = propBindingModes.ONE_TIME
111111
}
112112
}

test/unit/specs/compiler/compile_spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,9 @@ if (_.inBrowser) {
313313
'v-bind:test-normal="a" ' +
314314
'test-literal="1" ' +
315315
':optimize-literal="1" ' +
316-
':test-two-way&="a" ' +
317-
':two-way-warn&="a + 1" ' +
318-
':test-one-time*="a"></div>'
316+
':test-two-way.sync="a" ' +
317+
':two-way-warn.sync="a + 1" ' +
318+
':test-one-time.once="a"></div>'
319319
compiler.compileAndLinkProps(vm, el.firstChild, props)
320320
expect(vm._bindDir.calls.count()).toBe(3) // skip literal and one time
321321
// literal

test/unit/specs/directives/prop_spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ if (_.inBrowser) {
9999
a: 'A'
100100
}
101101
},
102-
template: '<test v-bind:testt&="test" :bb&="b" :a&=" test.a " v-ref="child"></test>',
102+
template: '<test v-bind:testt.sync="test" :bb.sync="b" :a.sync=" test.a " v-ref="child"></test>',
103103
components: {
104104
test: {
105105
props: ['testt', 'bb', 'a'],
@@ -195,7 +195,7 @@ if (_.inBrowser) {
195195
data: {
196196
b: 'B'
197197
},
198-
template: '<test v-ref:child :b*="b"></test>',
198+
template: '<test v-ref:child :b.once="b"></test>',
199199
components: {
200200
test: {
201201
props: ['b'],
@@ -245,7 +245,7 @@ if (_.inBrowser) {
245245
data: {
246246
b: 'B'
247247
},
248-
template: '<test :b&="b + \'B\'" v-ref="child"></test>',
248+
template: '<test :b.sync="b + \'B\'" v-ref="child"></test>',
249249
components: {
250250
test: {
251251
props: ['b'],

0 commit comments

Comments
 (0)