Skip to content

Commit e1de434

Browse files
committed
v-data
1 parent 7628105 commit e1de434

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/directives/index.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
var utils = require('../utils'),
22
config = require('../config'),
3-
transition = require('../transition')
3+
transition = require('../transition'),
4+
NumberRE = /^[\d\.]+$/,
5+
CommaRE = /\\,/g
46

57
module.exports = {
68

@@ -54,6 +56,18 @@ module.exports = {
5456
el.removeAttribute(config.prefix + '-cloak')
5557
})
5658
}
59+
},
60+
61+
data: {
62+
bind: function () {
63+
var val = this.key
64+
this.vm.$set(
65+
this.arg,
66+
NumberRE.test(val)
67+
? +val
68+
: val.replace(CommaRE, ',')
69+
)
70+
}
5771
}
5872

5973
}

0 commit comments

Comments
 (0)