Comments (1)
this.formData是有双向绑定的,你看this对象上formData有劫持到get set方法就可以排除
没有出现响应式的原因是因为render.js-18行代码
dataObject.props.value = defaultValue
其实就是相当于 <input v-model="defaultValue">
正常来说应该是<input v-model="formData.mobile">
才对,作者这里这样写是为了让默认值能出现在input上,但是这样也导致了你直接修改formData它无法回显的问题。
所以要修改这个问题也很简单,在兼容之前的代码基础上:
1将formData传入render.js
//render.js
props: {
conf: {
type: Object,
required: true
},
++ formData: {
++ type: Object
++ }
}
2.将<input v-model="defaultValue">
改为<input v-model="formData.mobile">
并且兼容之前的代码
// 注意这里要加一个参数获取vModel
//render.js-53行:
++vModel.call(this, dataObject, confClone.__config__.defaultValue, confClone)
//render.js-17行:
++function vModel(dataObject, defaultValue, conf) {
++ dataObject.props.value = this.formData ? this.formData[conf.__vModel__] : defaultValue
dataObject.on.input = val => {
this.$emit('input', val)
}
}
3.在Parse.vue-28将formData传入给render.js使用
Parse.vue-28
++ <render conf={scheme} on={listeners} formData={this[this.formConf.formModel]}/>
然后再测试一下,你就会发现,好使了。
from form-generator.
Related Issues (20)
- 流程表单上传文件后回显问题
- input输入框的后缀如何变成能够选择的单位
- 右侧修改组件类型会出现报错
- 如何生成非表单的内容
- 富文本编辑器回显的时候怎么去掉本身的样式,只是拿到内容进行回显呢?
- 关于 Parser.vue 表单解析后数据无法绑定的问题 HOT 1
- 输入型组件切换为选择型组件后,添加选项报错 HOT 1
- vue3压根跑不起来 HOT 3
- Uncaught TypeError: h is not a function HOT 1
- 按钮不显示文字
- Home.vue是不是没有开入口给用户进行自定义
- 表单下拉框如何与数据字典、接口绑定数据值 HOT 2
- 如何实现动态布局的组件 HOT 1
- 低代码流程设计器
- Vue3 版本 HOT 1
- 能否改变拖拽时组件默认栅格
- 关于 Parser.vue一直报:please transfer a valid prop path to firm item
- 启动报错 HOT 1
- 级联选择器开启多选,模糊查询后,不能多选的bug。 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from form-generator.