|
@@ -5,18 +5,12 @@ module.exports = {
|
|
|
priority: 900,
|
|
priority: 900,
|
|
|
|
|
|
|
|
bind: function () {
|
|
bind: function () {
|
|
|
- if (!this.arg) {
|
|
|
|
|
- // by default, components have _noSync:true
|
|
|
|
|
- // but when there's no arg it means we are
|
|
|
|
|
- // inheriting a parent object as $data, so we have
|
|
|
|
|
- // to sync the chagnes
|
|
|
|
|
- this.vm.$options._noSync = false
|
|
|
|
|
|
|
+ if (this.arg) {
|
|
|
|
|
+ var self = this
|
|
|
|
|
+ this.vm.$watch(this.arg, function (val) {
|
|
|
|
|
+ self.set(_.toNumber(val))
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
- var self = this
|
|
|
|
|
- var path = this.arg || '$data'
|
|
|
|
|
- this.vm.$watch(path, function (val) {
|
|
|
|
|
- self.set(_.toNumber(val))
|
|
|
|
|
- })
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
update: function (value) {
|
|
update: function (value) {
|