Skip to content

Commit

Permalink
chore: optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
uyarn committed Feb 4, 2025
1 parent cbcd9db commit a75ff69
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
4 changes: 2 additions & 2 deletions js/tree-v1/tree-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class TreeStore {
if (val !== config[key]) {
hasChanged = true;
// @ts-ignore
// TODO: 待移除
// TODO: https://github.com/microsoft/TypeScript/issues/32693
config[key] = val;
}
});
Expand Down Expand Up @@ -309,7 +309,7 @@ export class TreeStore {
nodes = nodes.filter((node) => {
const result = Object.keys(conf.props).every((key) => {
// @ts-ignore
// TODO: 待移除
// TODO: https://github.com/microsoft/TypeScript/issues/32693
const propEqual = node[key] === conf.props[key];
return propEqual;
});
Expand Down
4 changes: 2 additions & 2 deletions js/tree/tree-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export class TreeStore {
if (val !== config[key]) {
hasChanged = true;
// @ts-ignore
// TODO: 待移除
// TODO: https://github.com/microsoft/TypeScript/issues/32693
config[key] = val;
}
});
Expand Down Expand Up @@ -313,7 +313,7 @@ export class TreeStore {
nodes = nodes.filter((node) => {
const result = Object.keys(conf.props).every((key) => {
// @ts-ignore
// TODO: 待移除
// TODO: https://github.com/microsoft/TypeScript/issues/32693
const propEqual = node[key] === conf.props[key];
return propEqual;
});
Expand Down
13 changes: 3 additions & 10 deletions js/utils/set-style.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
import { Styles } from '../common';

/**
* 用于为el节点增加styles ,migrate from tdesign-vue repo
* 用于为节点增加styles
* @param el HTMLElement
* @param style Styles
*/
function setStyle(el: HTMLElement, styles: Styles): void {
const keys = Object.keys(styles);
keys.forEach((key) => {
// @ts-ignore
// eslint-disable-next-line no-param-reassign
el.style[key] = styles[key];
Object.entries(styles).forEach(([key, value]) => {
el.style.setProperty(key, String(value));
});
// TODO: 建议改成如下
// Object.entries(styles).forEach(([key, value]) => {
// el.style.setProperty(key, String(value));
// });
}

export default setStyle;

0 comments on commit a75ff69

Please sign in to comment.