1.0.2 • Published 4 years ago

element-common-select v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

element-common-select

说明:element下拉框二次封装

方法名参数类型说明
lablesstring传入当前绑定的字段名称
defaultValstring传入默认值(如果有)
optionsArray传入下拉列表数组
optLabelstring传入下拉指定的中文字段
optValstring传入下拉指定的value字段
disabledBoolean是否禁用
isMultipleBoolean是否多选
selectChangeval, labelBoolean回调抛出当前值,当前绑定的字段名称

Example

<template>
  <div id="app">
    <ElementCommonSelect lables="val1" :options="opt1" optLabel="names" optVal="ids" @selectChange="selectChange"></ElementCommonSelect>
    <ElementCommonSelect lables="val2" :options="opt2" optLabel="label" optVal="keys" @selectChange="selectChange"></ElementCommonSelect>
    <ElementCommonSelect lables="val3" :options="opt3" optLabel="title" optVal="value" @selectChange="selectChange"></ElementCommonSelect>
  </div>
</template>

<script>
import ElementCommonSelect from 'element-common-select'

export default {
  name: 'App',
  components: {
    ElementCommonSelect
  },
  data () {
    return {
        form: {
            val1: '',
            val2: '', 
            val3: ''
        },
        opt1: [
            {names: '选项1', ids: 1},
            {names: '选项2', ids: 2},
            {names: '选项3', ids: 3}
        ],
        opt2: [
            {label: 'lable1', keys: 1},
            {label: 'label2', keys: 2},
            {label: 'label3', keys: 3},
        ],
        opt3: [
            {title: 'title1', value: 1},
            {title: 'title2', value: 2},
            {title: 'title3', value: 3}
        ]
    }
  },
  methods: {
      selectChange (val, label) {
          this.form[label] = val
      }
  }
}
</script>

<style>
</style>
1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago