提交 a25f90ad 编写于 作者: fxy060608's avatar fxy060608

fix(mp): v-model support dynamic add reactive properties

上级 1fd9e9d2
...@@ -4087,10 +4087,10 @@ function updateChildComponent ( ...@@ -4087,10 +4087,10 @@ function updateChildComponent (
// keep a copy of raw propsData // keep a copy of raw propsData
vm.$options.propsData = propsData; vm.$options.propsData = propsData;
} }
// fixed by xxxxxx update properties(mp runtime) // fixed by xxxxxx update properties(mp runtime)
vm._$updateProperties && vm._$updateProperties(vm); vm._$updateProperties && vm._$updateProperties(vm);
// update listeners // update listeners
listeners = listeners || emptyObject; listeners = listeners || emptyObject;
var oldListeners = vm.$options._parentListeners; var oldListeners = vm.$options._parentListeners;
...@@ -4621,7 +4621,7 @@ function initProps (vm, propsOptions) { ...@@ -4621,7 +4621,7 @@ function initProps (vm, propsOptions) {
} }
//fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警 //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
if( if(
key === 'value' && key === 'value' &&
Array.isArray(vm.$options.behaviors) && Array.isArray(vm.$options.behaviors) &&
vm.$options.behaviors.indexOf('uni://form-field') !== -1 vm.$options.behaviors.indexOf('uni://form-field') !== -1
){ ){
...@@ -4633,7 +4633,7 @@ function initProps (vm, propsOptions) { ...@@ -4633,7 +4633,7 @@ function initProps (vm, propsOptions) {
var $parent = vm.$parent; var $parent = vm.$parent;
while($parent){ while($parent){
if($parent.__next_tick_pending){ if($parent.__next_tick_pending){
return return
} }
$parent = $parent.$parent; $parent = $parent.$parent;
} }
...@@ -4965,10 +4965,10 @@ function initMixin (Vue) { ...@@ -4965,10 +4965,10 @@ function initMixin (Vue) {
initEvents(vm); initEvents(vm);
initRender(vm); initRender(vm);
callHook(vm, 'beforeCreate'); callHook(vm, 'beforeCreate');
!vm._$fallback && initInjections(vm); // resolve injections before data/props !vm._$fallback && initInjections(vm); // resolve injections before data/props
initState(vm); initState(vm);
!vm._$fallback && initProvide(vm); // resolve provide after data/props !vm._$fallback && initProvide(vm); // resolve provide after data/props
!vm._$fallback && callHook(vm, 'created'); !vm._$fallback && callHook(vm, 'created');
/* istanbul ignore if */ /* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && config.performance && mark) { if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
...@@ -5694,7 +5694,7 @@ function mountComponent$1( ...@@ -5694,7 +5694,7 @@ function mountComponent$1(
} }
} }
} }
!vm._$fallback && callHook(vm, 'beforeMount'); !vm._$fallback && callHook(vm, 'beforeMount');
var updateComponent = function () { var updateComponent = function () {
...@@ -5893,14 +5893,16 @@ function internalMixin(Vue) { ...@@ -5893,14 +5893,16 @@ function internalMixin(Vue) {
if (!target) { if (!target) {
target = this; target = this;
} }
target[key] = value; // 解决动态属性添加
Vue.set(target, key, value)
}; };
Vue.prototype.__set_sync = function(target, key, value) { Vue.prototype.__set_sync = function(target, key, value) {
if (!target) { if (!target) {
target = this; target = this;
} }
target[key] = value; // 解决动态属性添加
Vue.set(target, key, value)
}; };
Vue.prototype.__get_orig = function(item) { Vue.prototype.__get_orig = function(item) {
...@@ -6033,7 +6035,7 @@ Vue.prototype.__patch__ = patch; ...@@ -6033,7 +6035,7 @@ Vue.prototype.__patch__ = patch;
// public mount method // public mount method
Vue.prototype.$mount = function( Vue.prototype.$mount = function(
el , el ,
hydrating hydrating
) { ) {
return mountComponent$1(this, el, hydrating) return mountComponent$1(this, el, hydrating)
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册