vue methods中取不到data值export default { name: "sysAdd", data() { return { form: { name: '', region: '', date1: '', date2: '', delivery: false, type: [], resource: '', desc: '' }, formLabelWidth: '120px', visible:false }; }, props:['show'], watch:{ show(){ this.visible = this.show; } }, methods:{ save(){ console.info(this.from,this.formLabelWidth,this.$options.data().form); saveAdd(this.from).then(response => { console.info('222'+ response.data); }) }, close_dialog_event(){ //通知父组件改变show的值 this.$emit('dialog_event'); } } }
添加回答
举报
0/150
提交
取消