0.0.2 • Published 8 months ago
hetc v0.0.2
Vue2 based UI components
Install dependencies
npm install hetc
setp up
import Vue from 'vue'
import Hetc from 'hetc'
Vue.use(Hetc)
<template>
<div>
<h-form :config="columns" :data="formData"></h-form>
<h-dict v-model="dictValue" :dict="dict"></h-dict>
<h-modal :config="modalConfig">
<div>Default content</div>
</h-modal>
</div>
</template>
export default {
data () {
this.dict = new Dict({
data: [],
url: 'xxx',
value: 'value',
children: 'children',
label: 'label',
isTree: false
})
return {
dictValue: 'ZH',
list: [],
modalConfig: { show: false, type: 'dialog', title: 'Modal Title' },
columns: [
{
title: 'username',
name: 'input',
key: 'name',
span: 12,
props: { 'show-word-limit': true, maxlength: 10, readonly: false }
},
{
title: 'age',
name: 'checkboxGroup',
key: 'age',
span: 12,
props: { placeholder: 'Please select' },
dict: [
{ label: 'China', value: 'ZH' },
{ label: 'USA', value: 'USA' }
]
}
],
formData: { name: 'Initial value', age: ['ZH'] }
}
}
}
</script>