console
new Vue({
el: "#app",
data: {
options: {
formItem: [
{
type: 'switch',
label: '大',
props: {
size: 'large'
}
},
{
type: 'switch',
label: '中',
},
{
type: 'switch',
label: '小',
props: {
size: 'small'
}
},
{
type: 'switch',
label: '文字',
children: [
{
type: 'span',
slot: 'open',
text: '开'
},
{
type: 'span',
slot: 'close',
text: '关'
},
]
},
{
type: 'switch',
label: '图标',
children: [
{
type: 'icon',
slot: 'open',
props: {
type: 'md-checkmark'
}
},
{
type: 'icon',
slot: 'close',
props: {
type: 'md-close'
}
},
]
},
]
}
}
})
<link rel="stylesheet" href="//unpkg.com/view-design/dist/styles/iview.css">
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"></script>
<script src="//unpkg.com/view-design/dist/iview.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-form-maker/dist/vue-form-maker.js"></script>
<div id="app">
<vue-form-maker :options="options" />
</div>
#app {
padding: 10px 20px;
}