Comments (9)
你是指 type: array ,配置了 ui:widget ? widget 都是v-model的形式,$emit('input', value);
from vue-json-schema-form.
from vue-json-schema-form.
你可以提供下codepon或类似代码演示。
如果ui:widget,需要v-model双向绑定值,实际就是 value props,和 emit('input', newValue) 更新数据
from vue-json-schema-form.
这是json
"schema": { "type": "object", "required": [], "properties": { //模板选择 "dataSource": { "type": "array", "title": "显示内容(至少选中两个)", "items": { "type": "string", "enum": [ "1", "2", "3", "4" ], "enumNames": [ "为你推荐", "新品上架", "热销商品", "聚划算" ] }, "default":[], "uniqueItems": true }, "fontWeight": { "title": "文本样式", "type": "string", "ui:widget": "RadioWidget", "default": "normal", "enum": [ "normal", "bold" ], "enumNames": [ "常规", "加粗" ] } }, "ui:order": [ "dataSource", "fontWeight" ] }, "uiSchema": { "dataSource": { // 'ui:widget': 'RadioWidget' 'ui:widget': () => import('@/components/themeEditor/componentsProperties/pageActive-CheckDataType') } }, "formFooter": { "show": false }, "formProps": { // "labelPosition": "left", "labelWidth": "100px", "labelSuffix": ":" }
这是自定义组件的代码
`
`
from vue-json-schema-form.
实际测试只有type为string的自定义widget 可以用$emit( input )更新
from vue-json-schema-form.
你这里 emit 出去的字符串,是为了测试你说的字符串对吗 ? 你提供一个 在线 https://codepen.io/ 代码演示吧
--
内部组件数组的同步值也是类似,比如 多选框,多文件上传都是这样方式,也可以参考下。
from vue-json-schema-form.
好的。如果实在不能更新数组枚举,我就只能改变方式,用字符串模式。谢谢你的回复。
from vue-json-schema-form.
不客气,最终还是不行可以带上 在线代码演示。
from vue-json-schema-form.
晚些我会我会截图说明。
from vue-json-schema-form.
Related Issues (20)
- 自定义field组件,如何通过$emit()调用父组件方法 HOT 4
- vue-json-schema-form 使用的element-ui 的select 可以自定义备选项吗 HOT 1
- Type 类型兼容数组不报错
- 模块 ""@lljj/vue3-form-ant"" 没有导出的成员 "JsonSchemaFormAntdV4" HOT 1
- 建议支持Dialog HOT 2
- 布局配置:formProps属性不生效 HOT 3
- 如何将保存和取消按钮放置在整个页面其他位置,而不是最底端
- [求助] 夜间模式下,array的背景不会自动成暗色 HOT 3
- Inline props not working
- AutoCompleteWidget如何使用 HOT 1
- input number默认失去焦点才更新form,如何修改这个行为?希望可以在用户输入的时候实时更新form数据 HOT 1
- 关于Vue JSON Schema Form使用文本框加上的图标问题 HOT 1
- 有考虑支持 arco design 的vue版本吗 HOT 1
- on-validation-failed 事件 中的 errorObj 用 console.log 打印出来是undefine HOT 1
- 求助,map[string]string动态添加属性,如何生成schema HOT 3
- Q: schema 生成那个页面有导出组件使用吗 HOT 1
- Vue3中, 对Vue-Form进行复用, 之前的formData没有清除, 带到下一次提交的值中了 HOT 1
- Vue3使用SelectWidget多选,插槽没起效果 HOT 1
- import VueForm 的时候报错了 HOT 1
- AnyOf/OneOf 子节点为`$ref`时,选项标题是“选项1、2...”,而非子节点的 `title` HOT 5
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 vue-json-schema-form.