mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-18 08:55:53 +08:00
智慧宿舍系统小程序
This commit is contained in:
36
wechat/miniprogram/node_modules/@vant/weapp/dist/switch/index.js
generated
vendored
Normal file
36
wechat/miniprogram/node_modules/@vant/weapp/dist/switch/index.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
import { VantComponent } from '../common/component';
|
||||
VantComponent({
|
||||
field: true,
|
||||
classes: ['node-class'],
|
||||
props: {
|
||||
checked: null,
|
||||
loading: Boolean,
|
||||
disabled: Boolean,
|
||||
activeColor: String,
|
||||
inactiveColor: String,
|
||||
size: {
|
||||
type: String,
|
||||
value: '30',
|
||||
},
|
||||
activeValue: {
|
||||
type: null,
|
||||
value: true,
|
||||
},
|
||||
inactiveValue: {
|
||||
type: null,
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onClick() {
|
||||
const { activeValue, inactiveValue, disabled, loading } = this.data;
|
||||
if (disabled || loading) {
|
||||
return;
|
||||
}
|
||||
const checked = this.data.checked === activeValue;
|
||||
const value = checked ? inactiveValue : activeValue;
|
||||
this.$emit('input', value);
|
||||
this.$emit('change', value);
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user