























这是一个创建于 873 天前的主题,其中的信息可能已经有所发展或是发生改变。
代码
addFrontLine(_line_location_, _padding_, _border_) {
console.log(_padding_);
console.log(_line_location_);
if (_padding_ >= _line_location_) {
_padding_ = _line_location_
}
console.log(_padding_);
console.log(_line_location_);
const css = `
.layout-tab-container .b3-list-item > .b3-list-item__toggle {
padding-left: 4px !important;
}
.layout-tab-container ul ul:before {
content: "";
position: absolute;
top: 0;
bottom: 0;
left: ${_line_location_}px;
border-left: ${_border_}px solid var(--b3-theme-background-light);
}
.layout-tab-container ul ul {
position: relative;
padding-left: ${_padding_}px;
}
`
this.applyStyles(css);
}
执行后控制台输出的值
6
20
20
20
如果把 if 语句注释掉,就恢复正常了。 有没有大佬帮看看是什么原因? 完整代码 https://github.com/zxkmm/siyuan_doctree_compress/blob/13f1b3cda6c721001c1c33ab449e6321bc791807/src/index.ts#L118
第 1 条附言 · 2024 年 1 月 23 日
抱歉抱歉,第一次写动态类型的语言,一下子没反应过来
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。