v3.0.6
This commit is contained in:
38
source/wx/xzs-student/component/iView/switch/index.js
Normal file
38
source/wx/xzs-student/component/iView/switch/index.js
Normal file
@@ -0,0 +1,38 @@
|
||||
Component({
|
||||
externalClasses: ['i-class'],
|
||||
properties : {
|
||||
value : {
|
||||
type : Boolean,
|
||||
value : false
|
||||
},
|
||||
//large small default
|
||||
size : {
|
||||
type : String,
|
||||
value : 'default'
|
||||
},
|
||||
// is or not disable
|
||||
disabled : {
|
||||
type : Boolean,
|
||||
value : false
|
||||
},
|
||||
// hidden inut name
|
||||
name : {
|
||||
type : String,
|
||||
value : ''
|
||||
}
|
||||
},
|
||||
options: {
|
||||
// 在组件定义时的选项中启用多slot支持
|
||||
multipleSlots: true
|
||||
},
|
||||
methods : {
|
||||
toggle(){
|
||||
if( this.data.disabled ) return;
|
||||
const data = this.data;
|
||||
const value = data.value ? false : true;
|
||||
this.triggerEvent('change',{
|
||||
value : value
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user