Merge branch 'master' into feature/add_test

This commit is contained in:
jiangruowei
2017-03-17 17:45:37 +08:00
22 changed files with 206 additions and 49 deletions

View File

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