mirror of
https://gitee.com/fit2cloud-feizhiyun/1Panel.git
synced 2024-12-05 13:29:11 +08:00
feat: 文件编辑器侧边栏指上和选中文件样式调整 (#5689)
This commit is contained in:
parent
9ca69732ca
commit
f0fbb02495
@ -442,3 +442,15 @@ html {
|
||||
.el-tag {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.monaco-editor-tree-light .el-tree-node__content:hover {
|
||||
background-color: #e5eefd;
|
||||
}
|
||||
|
||||
.monaco-editor-tree-dark .el-tree-node__content:hover {
|
||||
background-color: #111417;
|
||||
}
|
||||
|
||||
.monaco-editor-tree-dark .el-tree-node.is-current > .el-tree-node__content {
|
||||
background-color: #111417;
|
||||
}
|
||||
|
@ -344,6 +344,21 @@ const changeLanguage = () => {
|
||||
|
||||
const changeTheme = () => {
|
||||
monaco.editor.setTheme(config.theme);
|
||||
const themes = {
|
||||
vs: 'monaco-editor-tree-light',
|
||||
'vs-dark': 'monaco-editor-tree-dark',
|
||||
'hc-black': 'monaco-editor-tree-dark',
|
||||
};
|
||||
|
||||
if (treeRef.value) {
|
||||
Object.values(themes).forEach((themeClass) => {
|
||||
treeRef.value.$el.classList.remove(themeClass);
|
||||
});
|
||||
if (themes[config.theme]) {
|
||||
treeRef.value.$el.classList.add(themes[config.theme]);
|
||||
}
|
||||
}
|
||||
|
||||
localStorage.setItem(codeThemeKey, config.theme);
|
||||
};
|
||||
|
||||
@ -455,6 +470,7 @@ const getDirectoryPath = (filePath: string) => {
|
||||
|
||||
const onOpen = () => {
|
||||
initEditor();
|
||||
changeTheme();
|
||||
search(directoryPath.value).then((res) => {
|
||||
handleSearchResult(res);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user