1
This commit is contained in:
64
uview-plus/components/u-switch/props.js
Normal file
64
uview-plus/components/u-switch/props.js
Normal file
@@ -0,0 +1,64 @@
|
||||
import { defineMixin } from '../../libs/vue'
|
||||
import defProps from '../../libs/config/props.js'
|
||||
export const props = defineMixin({
|
||||
props: {
|
||||
// 是否为加载中状态
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: () => defProps.switch.loading
|
||||
},
|
||||
// 是否为禁用装填
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: () => defProps.switch.disabled
|
||||
},
|
||||
// 开关尺寸,单位px
|
||||
size: {
|
||||
type: [String, Number],
|
||||
default: () => defProps.switch.size
|
||||
},
|
||||
// 打开时的背景颜色
|
||||
activeColor: {
|
||||
type: String,
|
||||
default: () => defProps.switch.activeColor
|
||||
},
|
||||
// 关闭时的背景颜色
|
||||
inactiveColor: {
|
||||
type: String,
|
||||
default: () => defProps.switch.inactiveColor
|
||||
},
|
||||
// 通过v-model双向绑定的值
|
||||
// #ifdef VUE3
|
||||
modelValue: {
|
||||
type: [Boolean, String, Number],
|
||||
default: () => defProps.switch.value
|
||||
},
|
||||
// #endif
|
||||
// #ifdef VUE2
|
||||
value: {
|
||||
type: [Boolean, String, Number],
|
||||
default: () => defProps.switch.value
|
||||
},
|
||||
// #endif
|
||||
// switch打开时的值
|
||||
activeValue: {
|
||||
type: [String, Number, Boolean],
|
||||
default: () => defProps.switch.activeValue
|
||||
},
|
||||
// switch关闭时的值
|
||||
inactiveValue: {
|
||||
type: [String, Number, Boolean],
|
||||
default: () => defProps.switch.inactiveValue
|
||||
},
|
||||
// 是否开启异步变更,开启后需要手动控制输入值
|
||||
asyncChange: {
|
||||
type: Boolean,
|
||||
default: () => defProps.switch.asyncChange
|
||||
},
|
||||
// 圆点与外边框的距离
|
||||
space: {
|
||||
type: [String, Number],
|
||||
default: () => defProps.switch.space
|
||||
}
|
||||
}
|
||||
})
|
||||
24
uview-plus/components/u-switch/switch.js
Normal file
24
uview-plus/components/u-switch/switch.js
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* @Author : LQ
|
||||
* @Description :
|
||||
* @version : 1.0
|
||||
* @Date : 2021-08-20 16:44:21
|
||||
* @LastAuthor : LQ
|
||||
* @lastTime : 2021-08-20 17:22:24
|
||||
* @FilePath : /u-view2.0/uview-ui/libs/config/props/switch.js
|
||||
*/
|
||||
export default {
|
||||
// switch
|
||||
switch: {
|
||||
loading: false,
|
||||
disabled: false,
|
||||
size: 25,
|
||||
activeColor: '#2979ff',
|
||||
inactiveColor: '#ffffff',
|
||||
value: false,
|
||||
activeValue: true,
|
||||
inactiveValue: false,
|
||||
asyncChange: false,
|
||||
space: 0
|
||||
}
|
||||
}
|
||||
216
uview-plus/components/u-switch/u-switch.vue
Normal file
216
uview-plus/components/u-switch/u-switch.vue
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user