feat(Form): binding checkbox
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
* Common part of Checkbox & Radio
|
||||
*/
|
||||
import Icon from '../icon';
|
||||
import { FieldMixin } from './field';
|
||||
import { ChildrenMixin } from './relation';
|
||||
import { addUnit } from '../utils';
|
||||
|
||||
export const CheckboxMixin = ({ parent, bem, role }) => ({
|
||||
mixins: [ChildrenMixin(parent)],
|
||||
mixins: [ChildrenMixin(parent), FieldMixin],
|
||||
|
||||
props: {
|
||||
name: null,
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
export const FieldMixin = {
|
||||
inject: {
|
||||
vanField: {
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
|
||||
created() {
|
||||
if (this.vanField) {
|
||||
this.vanField.children = this;
|
||||
}
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user