Closed li9156 closed 4 years ago
<a-form-item :label="item.label" style="margin-bottom: 5px;"> <a-select :placeholder="item.placeholder" :disabled="item.edit?JSON.parse(item.edit):false" @change="selectChanges(item,$event)" v-decorator="[ item.pops, { rules: [{ required: item.required?item.required:false, message: item.message }]} ]"> <a-select-option v-for="(items,index) in item.selectData" :key="index" :value="items.value">{{items.name}} </a-select-option> </a-select> </a-form-item> 我封装好的组件 arriveOrderInfoApi(params).then((value) => { if (value.code === 200) { let result = [] console.log(value.data) console.log(this.$refs.editFilter.$form.props.form) // this.$refs.editFilter.form = value.data } else { this.$notification['warning']({ message: '错误', description: value.message || '请求出现错误,请稍后再试', duration: 4 }) } 我在父级请求到数据给这个组件赋值是怎么赋值的呢?没有百度到!抱歉
<a-form-item :label="item.label" style="margin-bottom: 5px;"> <a-select :placeholder="item.placeholder" :disabled="item.edit?JSON.parse(item.edit):false" @change="selectChanges(item,$event)" v-decorator="[ item.pops, { rules: [{ required: item.required?item.required:false, message: item.message }]} ]"> <a-select-option v-for="(items,index) in item.selectData" :key="index" :value="items.value">{{items.name}} </a-select-option> </a-select> </a-form-item>
arriveOrderInfoApi(params).then((value) => { if (value.code === 200) { let result = [] console.log(value.data) console.log(this.$refs.editFilter.$form.props.form) // this.$refs.editFilter.form = value.data } else { this.$notification['warning']({ message: '错误', description: value.message || '请求出现错误,请稍后再试', duration: 4 }) }
<a-form-item :label="item.label" style="margin-bottom: 5px;"> <a-select :placeholder="item.placeholder" :disabled="item.edit?JSON.parse(item.edit):false" @change="selectChanges(item,$event)" v-decorator="[ item.pops, { rules: [{ required: item.required?item.required:false, message: item.message }]} ]"> <a-select-option v-for="(items,index) in item.selectData" :key="index" :value="items.value">{{items.name}} </a-select-option> </a-select> </a-form-item>
我封装好的组件arriveOrderInfoApi(params).then((value) => { if (value.code === 200) { let result = [] console.log(value.data) console.log(this.$refs.editFilter.$form.props.form) // this.$refs.editFilter.form = value.data } else { this.$notification['warning']({ message: '错误', description: value.message || '请求出现错误,请稍后再试', duration: 4 }) }
我在父级请求到数据给这个组件赋值是怎么赋值的呢?没有百度到!抱歉