Skip to content

Commit 3175756

Browse files
committed
change two-way binding indicator from @ to &
1 parent ea22426 commit 3175756

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

examples/modal/index.html

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

src/compiler/compile-props.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ module.exports = function compileProps (el, propOptions) {
5757

5858
// then check dynamic version
5959
if ((value = _.getBindAttr(el, attr)) === null) {
60-
if ((value = _.getBindAttr(el, attr + '@')) !== null) {
60+
if ((value = _.getBindAttr(el, attr + '&')) !== null) {
6161
prop.mode = propBindingModes.TWO_WAY
6262
} else if ((value = _.getBindAttr(el, attr + '*')) !== null) {
6363
prop.mode = propBindingModes.ONE_TIME

src/parsers/text.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ exports.parse = function (text) {
5757
}
5858
var tokens = []
5959
var lastIndex = tagRE.lastIndex = 0
60-
var match, index, html, value, first, oneTime, twoWay
60+
var match, index, html, value, first, oneTime
6161
/* eslint-disable no-cond-assign */
6262
while (match = tagRE.exec(text)) {
6363
/* eslint-enable no-cond-assign */
@@ -73,16 +73,14 @@ exports.parse = function (text) {
7373
value = html ? match[1] : match[2]
7474
first = value.charCodeAt(0)
7575
oneTime = first === 42 // *
76-
twoWay = first === 64 // @
77-
value = oneTime || twoWay
76+
value = oneTime
7877
? value.slice(1)
7978
: value
8079
tokens.push({
8180
tag: true,
8281
value: value.trim(),
8382
html: html,
84-
oneTime: oneTime,
85-
twoWay: twoWay
83+
oneTime: oneTime
8684
})
8785
lastIndex = index + match[0].length
8886
}

test/unit/specs/compiler/compile_spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ if (_.inBrowser) {
230230
'v-bind:test-normal="a" ' +
231231
'test-literal="1" ' +
232232
':optimize-literal="1" ' +
233-
':test-two-way@="a" ' +
234-
':two-way-warn@="a + 1" ' +
233+
':test-two-way&="a" ' +
234+
':two-way-warn&="a + 1" ' +
235235
':test-one-time*="a"></div>'
236236
compiler.compileAndLinkProps(vm, el.firstChild, props)
237237
expect(vm._bindDir.calls.count()).toBe(3) // skip literal and one time

test/unit/specs/directives/internal/prop_spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ if (_.inBrowser) {
7373
a: 'A'
7474
}
7575
},
76-
template: '<test v-bind:testt@="test" :bb@="b" :a@=" test.a " $.child></test>',
76+
template: '<test v-bind:testt&="test" :bb&="b" :a&=" test.a " $.child></test>',
7777
components: {
7878
test: {
7979
props: ['testt', 'bb', 'a'],
@@ -145,7 +145,7 @@ if (_.inBrowser) {
145145
data: {
146146
b: 'B'
147147
},
148-
template: '<test :b@=" b + \'B\'" $.child></test>',
148+
template: '<test :b&=" b + \'B\'" $.child></test>',
149149
components: {
150150
test: {
151151
props: ['b'],
@@ -248,7 +248,7 @@ if (_.inBrowser) {
248248
a: 'A',
249249
b: 'B'
250250
},
251-
template: '<test :aa@="a" :bb="b"></test>',
251+
template: '<test :aa&="a" :bb="b"></test>',
252252
components: {
253253
test: {
254254
props: ['aa', 'bb'],

0 commit comments

Comments
 (0)