feat: update toast&switch

This commit is contained in:
jiangruowei
2017-03-17 11:30:53 +08:00
parent 9ccce7cd5c
commit 25ce414de2
6 changed files with 101 additions and 27 deletions

View File

@@ -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);
}
}
};