diff --git a/src/components/CommandEditor.vue b/src/components/CommandEditor.vue index 1b8095f..18c59c2 100644 --- a/src/components/CommandEditor.vue +++ b/src/components/CommandEditor.vue @@ -6,9 +6,10 @@ :quickcommandInfo="quickcommandInfo" class="absolute-left shadow-10" :style="{ - width: sideBarWidth, + width: sideBarWidth + 'px', background: $q.dark.isActive ? '#2d2d2d' : '#f2f2f2', zIndex: 1, + transition: '0.3s', }" v-if="showSidebar" > @@ -16,10 +17,30 @@
+
+ {{ sideBarWidth ? "收起" : "展开" }}侧栏 +
@@ -159,8 +181,8 @@ export default { data() { return { programLanguages: Object.keys(this.$programmings), - sideBarWidth: "290px", - languageBarHeight: "40px", + sideBarWidth: 250, + languageBarHeight: 40, canCommandSave: this.action.type === "code" ? false : true, quickcommandInfo: { features: { @@ -202,8 +224,11 @@ export default { }, computed: { allQuickCommandTags() { - return this.parent.allQuickCommandTags.filter( - (x) => x !== "默认" && x !== "未分类" && x !== "搜索结果" + return _.without( + this.parent.allQuickCommandTags, + "默认", + "未分类", + "搜索结果" ); }, }, @@ -293,6 +318,16 @@ export default { ] = res; }); }, + // 展开收起侧栏 + toggleSideBarWidth() { + if (this.sideBarWidth) { + this.lastSideBarWidth = this.sideBarWidth; + this.sideBarWidth = 0; + } else { + this.sideBarWidth = this.lastSideBarWidth; + this.lastSideBarWidth = 0; + } + }, // 自定义解释器路径界面 showCustomOptions() { quickcommand diff --git a/src/components/CommandMenu.vue b/src/components/CommandMenu.vue index 83473cb..5ad936a 100644 --- a/src/components/CommandMenu.vue +++ b/src/components/CommandMenu.vue @@ -256,12 +256,7 @@ export default { outputTypes: outputTypes, outputTypesOptions: Object.keys(outputTypes), specialVar: "{{}}", - allQuickCommandTags: _.without( - this.$parent.parent.allQuickCommandTags, - "默认", - "未分类", - "搜索结果" - ), + allQuickCommandTags: this.$parent.allQuickCommandTags, }; }, props: {