同步操作将从 GavinZhulei/vue-form-making 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
The secondary need development need fundamental comment of vue, regards vue you can refer to https://cn.vuejs.org/v2/guide/.
git clone https://github.com/GavinZhuLei/vue-form-making.git
npm install
npm run serve
You can rebuild the code if you have any change, and then put the package into dist directroy, the build command is as below:
npm run build-bundle
You can extend the attributes of the component as you need,we will show you how to do this:
src/components/Container.vue
<script>
export default {
// ...
data () {
return {
widgetForm: {
list: [],
config: {
labelWidth: 100,
labelPosition: 'top',
size: 'small'
// put you own attributes here
},
},
}
}
}
</script>
open src/components/FormConfig.vue
, modify the file to support your new attributes. the props.data
is the config data widgetForm.config.
open src/components/GenerateForm.vue
, modify the file to add your new attributes.
Modify src/components/componentsConfig.js to add you custom component information,currently we have 3 objects to save the component information , they are basicComponents advanceComponents layoutComponents, which we call them [Basic Component], [Advanced Component], [Layout] in MakeForm:
{
type: 'input', //component type
name: 'text', //The name of component,which will display in MakeFrom
icon: 'icon-input', //The icon of the component, you can customized the icon
options: { // The configuration of component
defaultValue: '', // Defalue value of the component
}
}
Import you component in src/components/WidgetFormItem.vue 、 src/components/GenerateFormItem.vue as below:
import CustomComponent from 'your component location'
export default {
components: {
CustomComponent
}
}
Modify src/components/WidgetConfig.vue according to your requirement, now you can use you own component in the FromMaking.
For default,we used Alibaba font icon library iconfont , if you want to customized the icon, you can copy you own icon file into the project to replace the default icon, if default icon is in src/iconfont.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。