From 0fe2ccf7f04f9c5b5c116fe61daf720688eaba06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Thu, 2 Jan 2025 14:23:08 +0800 Subject: [PATCH] chore: fix typo --- js/tree-v1/tree-node.ts | 8 ++++---- js/tree/tree-node.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/js/tree-v1/tree-node.ts b/js/tree-v1/tree-node.ts index e306f5f363..a0de2a43fb 100644 --- a/js/tree-v1/tree-node.ts +++ b/js/tree-v1/tree-node.ts @@ -22,7 +22,7 @@ const { hasOwnProperty } = Object.prototype; // 这里的属性为 data 中属性可以同步到 treeNode 实例属性的白名单 // 仅 label 属性和在列表中的属性可以通过 set 方法配置到 treeNode 实例上 -export const setableStatus: Record = { +export const settableStatus: Record = { expandMutex: null, activable: null, checkable: null, @@ -30,10 +30,10 @@ export const setableStatus: Record = { loading: false, }; -export const setableProps = Object.keys(setableStatus); +export const settableProps = Object.keys(settableStatus); export const syncableProps = [ - ...setableProps, + ...settableProps, 'actived', 'expanded', 'checked', @@ -557,7 +557,7 @@ export class TreeNode { const keys = Object.keys(item); keys.forEach((key) => { if ( - hasOwnProperty.call(setableStatus, key) + hasOwnProperty.call(settableStatus, key) || key === 'label' || key === 'disabled' ) { diff --git a/js/tree/tree-node.ts b/js/tree/tree-node.ts index 5fc3a705ad..a1d0b23e6c 100644 --- a/js/tree/tree-node.ts +++ b/js/tree/tree-node.ts @@ -26,7 +26,7 @@ const { hasOwnProperty } = Object.prototype; // 这里的属性为 data 中属性可以同步到 treeNode 实例属性的白名单 // 仅 label 属性和在列表中的属性可以通过 set 方法配置到 treeNode 实例上 -export const setableStatus: Record = { +export const settableStatus: Record = { expandMutex: null, activable: null, checkable: null, @@ -34,9 +34,9 @@ export const setableStatus: Record = { loading: false, }; -export const setableProps = Object.keys(setableStatus); +export const settableProps = Object.keys(settableStatus); -export const syncableProps = [...setableProps, 'actived', 'expanded', 'checked']; +export const syncableProps = [...settableProps, 'actived', 'expanded', 'checked']; export const privateKey = '__tdesign_id__'; @@ -557,7 +557,7 @@ export class TreeNode { const keys = Object.keys(item); keys.forEach((key) => { // key, disabled 字段可被 tree.config.keys 定义 - if (hasOwnProperty.call(setableStatus, key) || key === 'label') { + if (hasOwnProperty.call(settableStatus, key) || key === 'label') { this[key] = item[key]; } if (key === 'disabled') {