FromSwitch

引用组件

import {FromSwitch} from '@/components'

export default {
    components: {
      FromSwitch
    }
}

使用组件

<FromSwitch v-model="sex" :options="{
      title: '性别',
      defaultValue: sex,
      list: [
        {
            name: '男',
            value: 1,
            icon: require('../../assets/images/icon_male_n@3x.png'),
            activeIcon: require('../../assets/images/icon_male_h@3x.png')
        },
        {
            name: '女',
            value: 2,
            icon: require('../../assets/images/icon_female_n@3x.png'),
            activeIcon: require('../../assets/images/icon_female_h@3x.png')
        }
      ]
    }"></FromSwitch>

参数说明

参数 类型 示例 说明
title String '性别' 名称
defaultValue String || Number 1 默认选中的值
list Array name: String => 名称
value: String || Number => 值
icon: String => 未激活图标地址
activeIcon: String => 激活图标地址
每一项的参数

demo

https://yinmrsir.github.io/vue-SocialApp/#/join

results matching ""

    No results matching ""