FromSelect
表单select组件
引用组件
import {FromSelect} from '@/components'
export default {
components: {
FromSelect
}
}
使用组件
<FromSelect v-model="age" :slots="ageList" title="年龄"></FromSelect>
### data部分
ageList: [
{
flex: 1,
defaultIndex: 3,
values: ['18', '19', '20', '21', '22', '23'],
textAlign: 'center'
}
]
参数说明
| 参数 |
类型 |
示例 |
说明 |
| title |
String |
'年龄' |
名称 |
| v-model |
String |
'age' |
绑定值,用于接收组件返回数据 |
| slots |
Array |
[...Object] |
每一项为一个对象 |
slots 参数
| 参数 |
说明 |
| divider |
是否为分隔符 |
| content |
分隔符的显示文本 |
| values |
对应的备选值数组。若为对象数组,则需在标签上设置 value-key 属性来指定显示的字段名 |
| defaultIndex |
对应初始选中值,需传入其在 values 数组中的序号,默认为 0 |
| textAlign |
对应的对齐方式 |
| flex |
对应CSS 的 flex 值 |
| className |
对应的类名 |
demo
https://yinmrsir.github.io/vue-SocialApp/#/join