console
new Vue({
el: "#app",
data: {
rule: [formCreate.maker.input('商品名称1', 'goods_name1').props({
placeholder: '请输入商品名称'
}).validate([{
required: true,
message: '请输入商品名称',
trigger: 'blur'
}]), {
type: "input",
title: "商品名称2",
field: "goods_name2",
value: "iphone 7",
props: {
"type": "textarea",
"placeholder": "请输入商品名称",
"rows": 5
},
"col": {
"sm": {
"span": 10,
"offset": 7,
"labelWidth": 100
},
"xs": {
"span": 24,
"labelWidth": 40
}
},
validate: [{
required: true,
message: '请输入goods_name',
trigger: 'blur'
},
],
}]
}
})
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.min.js">
</script>
<script src="https://cdn.jsdelivr.net/npm/iview/dist/iview.min.js">
</script>
<script src="https://cdn.jsdelivr.net/npm/form-create/dist/form-create.min.js">
</script>
<div id="app">
<form-create :rule="rule" />
</div>
@import url("//cdn.jsdelivr.net/npm/iview/dist/styles/iview.css");
#app {
padding: 32px;
}