vue watcher errors
Error in callback for watcher TypeError: Cannot set property of undefined”
newHeaderFilterData (val, oldVal) {
// update
// console.log('filter val =', JSON.stringify(val, null, 4));
// console.log('filter this.packageList =', JSON.stringify(this.packageList, null, 4));
// if(val.app_id !== oldVal.app_id) {
// this.packagesOptions= [];
// if(val.app_id.length) {
// const apps = val.app_id.split(',');
// this.packagesOptions = this.packageList.filter(({value, packageId}) => apps.includes(value));
// } else {
// this.packagesOptions = this.packageList || [];
// }
// console.log('new this.packagesOptions =', JSON.stringify(this.packagesOptions, null, 4));
// } else {
// this.packagesOptions = this.packageList || [];
// }
},
packageList: {
handler: (val, oldVal) => {
console.log('filter val =', JSON.stringify(val, null, 4));
this.packagesOptions = val;
},
deep: true,
// immediate: true,
},
<el-form-item
class="bind-master-modal-form-item"
v-for="({
label,
key,
}, index) in items"
:key="index"
:label="label"
:label-width="formLabelWidth">
<TokenSelect
:selectModel="form[key]"
:selectOptions="packagesOptions"
:selectKey="key"
@search-event="searchHandler"
@select-event="selectHandler"
/>
</el-form-item>
refs
xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有️xgqfrms, 禁止转载 ️,侵权必究️!