fix: 修复明细表删除行时,会删除第一页数据的bug
This commit is contained in:
31
docs/表单二开/6_只改JS不改模版的二开.md
Normal file
31
docs/表单二开/6_只改JS不改模版的二开.md
Normal file
@ -0,0 +1,31 @@
|
||||
# 如何在二开中只修改脚本不修改模版
|
||||
|
||||
可以在继承SimpleFormSetup时,不指定模版
|
||||
|
||||
```vue
|
||||
<script>
|
||||
// 注意,这里继承的是SimpleFormSetup,使用script setup写法的组件无法继承,必须使用特别的版本
|
||||
import SimpleFormSetup from '/@/components/SimpleForm/src/SimpleFormSetup.vue';
|
||||
|
||||
export default {
|
||||
mixins: [SimpleFormSetup],
|
||||
setup(props, ctx) {
|
||||
const ret = SimpleFormSetup.setup(props, ctx);
|
||||
|
||||
return {
|
||||
...ret
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
formModel: {
|
||||
handler: function(oldVal, newVal){
|
||||
console.log('表单被改了!' + Math.random());
|
||||
this.formModel.zheDie17153 = this.formModel.zhaGe15916 + this.formModel.zhaGe22645
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
```
|
||||
这里可以通过对formModel的监控和修改完成计算、赋值操作。
|
||||
Reference in New Issue
Block a user