@@ -123,6 +123,7 @@ export const treeProps = () => {
123
123
*/
124
124
replaceFields : { type : Object as PropType < FieldNames > } ,
125
125
blockNode : { type : Boolean , default : undefined } ,
126
+ openAnimation : PropTypes . any ,
126
127
} ;
127
128
} ;
128
129
@@ -182,6 +183,7 @@ export default defineComponent({
182
183
selectable,
183
184
fieldNames,
184
185
replaceFields,
186
+ motion = props . openAnimation ,
185
187
} = props ;
186
188
const newProps = {
187
189
...attrs ,
@@ -197,6 +199,7 @@ export default defineComponent({
197
199
itemHeight = { 20 }
198
200
virtual = { virtual . value }
199
201
{ ...newProps }
202
+ motion = { motion }
200
203
ref = { treeRef }
201
204
prefixCls = { prefixCls . value }
202
205
class = { classNames (
@@ -226,103 +229,4 @@ export default defineComponent({
226
229
) ;
227
230
} ;
228
231
} ,
229
- // methods: {
230
- // renderSwitcherIcon(prefixCls: string, switcherIcon: VNode, { isLeaf, loading, expanded }) {
231
- // const { showLine } = this.$props;
232
- // if (loading) {
233
- // return <LoadingOutlined class={`${prefixCls}-switcher-loading-icon`} />;
234
- // }
235
-
236
- // if (isLeaf) {
237
- // return showLine ? <FileOutlined class={`${prefixCls}-switcher-line-icon`} /> : null;
238
- // }
239
- // const switcherCls = `${prefixCls}-switcher-icon`;
240
- // if (switcherIcon) {
241
- // return cloneElement(switcherIcon, {
242
- // class: switcherCls,
243
- // });
244
- // }
245
- // return showLine ? (
246
- // expanded ? (
247
- // <MinusSquareOutlined class={`${prefixCls}-switcher-line-icon`} />
248
- // ) : (
249
- // <PlusSquareOutlined class={`${prefixCls}-switcher-line-icon`} />
250
- // )
251
- // ) : (
252
- // <CaretDownFilled class={switcherCls} />
253
- // );
254
- // },
255
- // updateTreeData(treeData: TreeDataItem[]) {
256
- // const { $slots } = this;
257
- // const defaultFields = { children: 'children', title: 'title', key: 'key' };
258
- // const replaceFields = { ...defaultFields, ...this.$props.replaceFields };
259
- // return treeData.map(item => {
260
- // const key = item[replaceFields.key];
261
- // const children = item[replaceFields.children];
262
- // const { slots = {}, class: cls, style, ...restProps } = item;
263
- // const treeNodeProps = {
264
- // ...restProps,
265
- // icon: $slots[slots.icon] || restProps.icon,
266
- // switcherIcon: $slots[slots.switcherIcon] || restProps.switcherIcon,
267
- // title: $slots[slots.title] || $slots.title || restProps[replaceFields.title],
268
- // dataRef: item,
269
- // key,
270
- // class: cls,
271
- // style,
272
- // };
273
- // if (children) {
274
- // return { ...treeNodeProps, children: this.updateTreeData(children) };
275
- // }
276
- // return treeNodeProps;
277
- // });
278
- // },
279
- // setTreeRef(node: VNode) {
280
- // this.tree = node;
281
- // },
282
- // handleCheck(checkedObj: (number | string)[], eventObj: CheckEvent) {
283
- // this.$emit('update:checkedKeys', checkedObj);
284
- // this.$emit('check', checkedObj, eventObj);
285
- // },
286
- // handleExpand(expandedKeys: (number | string)[], eventObj: ExpendEvent) {
287
- // this.$emit('update:expandedKeys', expandedKeys);
288
- // this.$emit('expand', expandedKeys, eventObj);
289
- // },
290
- // handleSelect(selectedKeys: (number | string)[], eventObj: SelectEvent) {
291
- // this.$emit('update:selectedKeys', selectedKeys);
292
- // this.$emit('select', selectedKeys, eventObj);
293
- // },
294
- // },
295
- // render() {
296
- // const props = getOptionProps(this);
297
- // const { prefixCls: customizePrefixCls, showIcon, treeNodes, blockNode } = props;
298
- // const getPrefixCls = this.configProvider.getPrefixCls;
299
- // const prefixCls = getPrefixCls('tree', customizePrefixCls);
300
- // const switcherIcon = getComponent(this, 'switcherIcon');
301
- // const checkable = props.checkable;
302
- // let treeData = props.treeData || treeNodes;
303
- // if (treeData) {
304
- // treeData = this.updateTreeData(treeData);
305
- // }
306
- // const { class: className, ...restAttrs } = this.$attrs;
307
- // const vcTreeProps = {
308
- // ...props,
309
- // prefixCls,
310
- // checkable: checkable ? <span class={`${prefixCls}-checkbox-inner`} /> : checkable,
311
- // children: getSlot(this),
312
- // switcherIcon: nodeProps => this.renderSwitcherIcon(prefixCls, switcherIcon, nodeProps),
313
- // ref: this.setTreeRef,
314
- // ...restAttrs,
315
- // class: classNames(className, {
316
- // [`${prefixCls}-icon-hide`]: !showIcon,
317
- // [`${prefixCls}-block-node`]: blockNode,
318
- // }),
319
- // onCheck: this.handleCheck,
320
- // onExpand: this.handleExpand,
321
- // onSelect: this.handleSelect,
322
- // } as Record<string, any>;
323
- // if (treeData) {
324
- // vcTreeProps.treeData = treeData;
325
- // }
326
- // return <VcTree {...vcTreeProps} />;
327
- // },
328
232
} ) ;
0 commit comments