feat: migrate Form component

This commit is contained in:
chenjiahan
2020-08-19 17:50:34 +08:00
parent e5368ed2f9
commit b6b6e38c45
12 changed files with 31 additions and 22 deletions
+1 -2
View File
@@ -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
View File
@@ -1,6 +1,7 @@
export const FieldMixin = {
inject: {
vanField: {
from: 'vanField',
default: null,
},
},
+2
View File
@@ -42,6 +42,8 @@ export function ChildrenMixin(parent, options = {}) {
const children = [...this.parent.children, this];
// TODO sortChildren
this.parent.children = children;
},
},