mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 11:17:41 +00:00
Merge branch 'master' into feature/add_test
This commit is contained in:
@@ -16,7 +16,6 @@ import ZanLoading from 'packages/loading';
|
||||
* @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>
|
||||
@@ -38,10 +37,6 @@ export default {
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
onChange: {
|
||||
type: Function,
|
||||
default: function() {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -58,7 +53,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