Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix typo #2015

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions js/tree-v1/tree-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ const { hasOwnProperty } = Object.prototype;

// 这里的属性为 data 中属性可以同步到 treeNode 实例属性的白名单
// 仅 label 属性和在列表中的属性可以通过 set 方法配置到 treeNode 实例上
export const setableStatus: Record<string, boolean | null> = {
export const settableStatus: Record<string, boolean | null> = {
expandMutex: null,
activable: null,
checkable: null,
draggable: null,
loading: false,
};

export const setableProps = Object.keys(setableStatus);
export const settableProps = Object.keys(settableStatus);

export const syncableProps = [
...setableProps,
...settableProps,
'actived',
'expanded',
'checked',
Expand Down Expand Up @@ -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'
) {
Expand Down
8 changes: 4 additions & 4 deletions js/tree/tree-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ const { hasOwnProperty } = Object.prototype;

// 这里的属性为 data 中属性可以同步到 treeNode 实例属性的白名单
// 仅 label 属性和在列表中的属性可以通过 set 方法配置到 treeNode 实例上
export const setableStatus: Record<string, boolean | null> = {
export const settableStatus: Record<string, boolean | null> = {
expandMutex: null,
activable: null,
checkable: null,
draggable: null,
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__';

Expand Down Expand Up @@ -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') {
Expand Down
Loading