Skip to content

Commit c08bc07

Browse files
committed
update two-way prop binding type indicator from @ to &
1 parent 4e02374 commit c08bc07

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

examples/modal/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<div id="app">
5959
<button id="show-modal" @click="showModal = true">Show Modal</button>
6060
<!-- use the modal component, pass in the prop -->
61-
<modal :show@="showModal">
61+
<modal :show&="showModal">
6262
<!--
6363
you can use custom content here to overwrite
6464
default content

src/compiler/compile-props.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ 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 + '&')) !== null) {
108108
prop.mode = propBindingModes.TWO_WAY
109109
} else if ((value = _.getBindAttr(el, attr + '*')) !== null) {
110110
prop.mode = propBindingModes.ONE_TIME

src/parsers/text.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ exports.parse = function (text) {
7373
value = html ? match[1] : match[2]
7474
first = value.charCodeAt(0)
7575
oneTime = first === 42 // *
76-
twoWay = first === 64 // @
76+
twoWay = first === 38 || first === 64 // & or @
7777
value = oneTime || twoWay
7878
? value.slice(1)
7979
: value

test/unit/specs/compiler/compile_spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ 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" ' +
316+
':test-two-way&="a" ' +
317+
':two-way-warn&="a + 1" ' +
318318
':test-one-time*="a"></div>'
319319
compiler.compileAndLinkProps(vm, el.firstChild, props)
320320
expect(vm._bindDir.calls.count()).toBe(3) // skip literal and one time

test/unit/specs/directives/prop_spec.js

Lines changed: 2 additions & 2 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&="test" :bb&="b" :a&=" test.a " v-ref="child"></test>',
103103
components: {
104104
test: {
105105
props: ['testt', 'bb', 'a'],
@@ -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&="b + \'B\'" v-ref="child"></test>',
249249
components: {
250250
test: {
251251
props: ['b'],

0 commit comments

Comments
 (0)