feat: migrate Form component
This commit is contained in:
@@ -2,12 +2,11 @@
|
||||
* 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), FieldMixin],
|
||||
mixins: [ChildrenMixin(parent)],
|
||||
|
||||
props: {
|
||||
name: null,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export const FieldMixin = {
|
||||
inject: {
|
||||
vanField: {
|
||||
from: 'vanField',
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -42,6 +42,8 @@ export function ChildrenMixin(parent, options = {}) {
|
||||
|
||||
const children = [...this.parent.children, this];
|
||||
|
||||
// TODO sortChildren
|
||||
|
||||
this.parent.children = children;
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user