(data: Schema, checkId = false)
| 917 | } |
| 918 | |
| 919 | import(data: Schema, checkId = false) { |
| 920 | const { componentName, id, children, props, ...extras } = data; |
| 921 | if (this.isSlot()) { |
| 922 | foreachReverse( |
| 923 | this.children!, |
| 924 | (subNode: INode) => { |
| 925 | subNode.remove(true, true); |
| 926 | }, |
| 927 | (iterable, idx) => (iterable as INodeChildren).get(idx), |
| 928 | ); |
| 929 | } |
| 930 | if (this.isParental()) { |
| 931 | this.props.import(props, extras); |
| 932 | this._children?.import(children, checkId); |
| 933 | } else { |
| 934 | this.props |
| 935 | .get('children', true)! |
| 936 | .setValue(isDOMText(children) || isJSExpression(children) ? children : ''); |
| 937 | } |
| 938 | } |
| 939 | |
| 940 | toData() { |
| 941 | return this.export(); |
no test coverage detected