mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 10:07:07 +00:00
feat: update toast&switch
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
* @param {boolean} [checked=false] - 开关状态
|
||||
* @param {boolean} [disabled=false] - 禁用
|
||||
* @param {boolean} [loading=false] - loading状态
|
||||
* @param {callback} [onChange] - 开关状态改变回调函数。
|
||||
*
|
||||
* @example
|
||||
* <zan-switch checked="true" disabled="false"></zan-switch>
|
||||
@@ -34,10 +33,6 @@ export default {
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
onChange: {
|
||||
type: Function,
|
||||
default: function() {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -54,7 +49,7 @@ export default {
|
||||
*/
|
||||
toggleState: function() {
|
||||
if (this.disabled || this.loading) return;
|
||||
this.onChange(!this.checked);
|
||||
this.$emit('change', !this.checked);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user