Comments (3)
@Sailiy 对的,目前的问题就是在组件逐渐增加的时候会持续在v-for中添加组件,暂时没有想到更好的解决办法,有好的想法可以一起交流
from vue-form-making.
你们可以考虑使用render方法,只要组件在全局或者局部注册过的输入组件名都能被渲染出来
我这里的拖动是自己写的,还有一些小问题,
官方文档:https://cn.vuejs.org/v2/guide/render-function.html
主要代码文件:https://github.com/Sailiy/vv-form-design/blob/master/src/views/Editor/EditMain.vue
render: function (h) { // h 为 createElement 函数,接受三个参数 return h('el-form', { props: { labelWidth: '80px' }, nativeOn: { dragover: this.handleOnRootDragOver, drop: this.handleOnRootDrop }, ref: 'FForm' }, this.allComponents.map((component, index) => { if (!component.hasOwnProperty('isActive')) this.$set(component, 'isActive', false) return h(component.name, { directives: [ { name: 'masking' } ], attrs: { 'data-index': index, draggable: true }, class: { active: component.isActive }, nativeOn: { click: (e) => { this.handleItemClick(e, index) }, dragstart: this.childrenDragStart }, ref: 'formItem' + index }) })) }
from vue-form-making.
后面可以考虑使用render
from vue-form-making.
Related Issues (20)
- 怎么判断一个组件在另一个组件内? HOT 1
- vue3 引用组件 HOT 2
- vue 引入之后,样式错误 HOT 3
- 有没有React版本的 HOT 1
- vue项目中引用后报错 HOT 2
- 自定义组件的readonly、disabled等属性不生效 HOT 1
- 严重问题:数据源中post请求会把params携带在url中 HOT 1
- 数据源中post请求配置config.data无效 HOT 2
- 安卓内嵌webview加载表单设计器中GenerateAntdForm组件无法执行执行js HOT 1
- 请教下作者如何实现深克隆,源码中并没有看到, :clone之类的配置 HOT 2
- i18n报错 HOT 1
- 商业使用问题 HOT 3
- !!!!
- 可以动态复制添加一个表格吗? HOT 1
- 请问添加数据源界面在哪? HOT 5
- 辣鸡 难用 HOT 2
- package.json 不全 HOT 1
- 编辑fm-making-form时无法加载出来原来保存的JSON数据出来 HOT 1
- vue3的版本要购买是吗? HOT 2
- 支持directive? HOT 1
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-form-making.