0.1.7 • Published 4 years ago

hy-components v0.1.7

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

hy-components

基于view-design UI封装的复合组件

Build Status npm npm downloads Coverage Status

install

npm i hy-components

components

FormSchema

表单片段生成器

  • Usage

HTML

<Form>
  <FormSchema v-model="form" :schema="schema" @name-on-change="cb" ></FormSchema>
</Form>

Javascript

import { FormSchema } from 'hy-components'

export default {
  components: { FormSchema },
  data() {
    return {
      form: {},
      schema: [
        { type: 'i-input', label: '姓名', prop: 'name', children: h => [h('span', { slot: 'append' }, '先生')], emit: ['on-change'], rules: [{ required: true, message: '请填写姓名', trigger: 'blur' }] },
        { type: 'radio-group', label: '性别', prop: 'sex', groups: [{ label: '男', value: 0 }, { label: '女', value: 1 }] },
        { type: 'checkbox-group', label: '爱好1', prop: 'like1', groups: [{ label: '游戏', value: 0 }, { label: '看书', value: 1 }] },
        { type: 'i-select', label: '爱好2', prop: 'like2', groups: [{ label: '游戏', value: 0 }, { label: '看书', value: 1 }] },
        { type: 'date-picker', label: '出生日期', prop: 'birthday', col: { span: 6 }, emit: ['on-change', 'on-open-change'] },
        { type: 'time-picker', label: '出生时间', prop: 'birthtime', col: { span: 6 } },
        { type: 'auto-complete', label: '自动完成', prop: 'ac', props: { data: ['小新', '奥特曼', '奥里给'] } },
      ],
    }
  },
  methods: {
    cb(arg1, arg2) {
      console.log(arg1)
    },
  },
}
0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago