mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 11:17:41 +00:00
[improvement] Checkbox: use relation mixin
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
* Common part of Checkbox & Radio
|
||||
*/
|
||||
import Icon from '../icon';
|
||||
import { FindParentMixin } from './find-parent';
|
||||
import { ChildrenMixin } from './relation';
|
||||
|
||||
export const CheckboxMixin = (parent, bem) => ({
|
||||
mixins: [FindParentMixin],
|
||||
mixins: [ChildrenMixin(parent)],
|
||||
|
||||
props: {
|
||||
name: null,
|
||||
@@ -20,10 +20,6 @@ export const CheckboxMixin = (parent, bem) => ({
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.findParent(parent);
|
||||
},
|
||||
|
||||
computed: {
|
||||
isDisabled() {
|
||||
return (this.parent && this.parent.disabled) || this.disabled;
|
||||
|
Reference in New Issue
Block a user