0.0.2 • Published 8 months ago

hetc v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

Vue2 based UI components

  1. Install dependencies

npm install hetc
  1. 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>
0.0.2

8 months ago

0.1.2

8 months ago

0.0.1

8 months ago