组件改名

This commit is contained in:
fofolee 2022-04-12 13:15:50 +08:00
parent 3ba0d01915
commit d3e2079f5a
2 changed files with 11 additions and 11 deletions

View File

@ -1,8 +1,8 @@
<template> <template>
<div class="relative"> <div class="relative">
<!-- 命令设置栏 --> <!-- 命令设置栏 -->
<CommandMenu <CommandSideBar
ref="menu" ref="sidebar"
:canCommandSave="canCommandSave" :canCommandSave="canCommandSave"
:quickcommandInfo="quickcommandInfo" :quickcommandInfo="quickcommandInfo"
class="absolute-left shadow-10" class="absolute-left shadow-10"
@ -13,7 +13,7 @@
transition: '0.3s', transition: '0.3s',
}" }"
v-if="showSidebar" v-if="showSidebar"
></CommandMenu> ></CommandSideBar>
<!-- 编程语言栏 --> <!-- 编程语言栏 -->
<div <div
class="absolute-top" class="absolute-top"
@ -158,11 +158,11 @@
<script> <script>
import MonocaEditor from "components/MonocaEditor"; import MonocaEditor from "components/MonocaEditor";
import CommandMenu from "components/CommandMenu"; import CommandSideBar from "components/CommandSideBar";
import CommandRunResult from "components/CommandRunResult"; import CommandRunResult from "components/CommandRunResult";
export default { export default {
components: { MonocaEditor, CommandMenu, CommandRunResult }, components: { MonocaEditor, CommandSideBar, CommandRunResult },
data() { data() {
return { return {
programLanguages: Object.keys(this.$programmings), programLanguages: Object.keys(this.$programmings),
@ -195,7 +195,7 @@ export default {
}, },
mounted() { mounted() {
this.init(); this.init();
this.$refs.menu?.init(); this.$refs.sidebar?.init();
}, },
computed: { computed: {
allQuickCommandTags() { allQuickCommandTags() {
@ -238,7 +238,7 @@ export default {
}, },
programChanged(value) { programChanged(value) {
this.setLanguage(value); this.setLanguage(value);
this.$refs.menu?.setIcon(value); this.$refs.sidebar?.setIcon(value);
}, },
// //
matchLanguage() { matchLanguage() {
@ -337,7 +337,7 @@ export default {
}, },
// //
saveCurrentCommand() { saveCurrentCommand() {
let updatedData = this.$refs.menu.SaveMenuData(); let updatedData = this.$refs.sidebar.SaveMenuData();
if (!updatedData) return; if (!updatedData) return;
Object.assign(this.quickcommandInfo, _.cloneDeep(updatedData)); Object.assign(this.quickcommandInfo, _.cloneDeep(updatedData));
let newQuickcommandInfo = _.cloneDeep(this.quickcommandInfo); let newQuickcommandInfo = _.cloneDeep(this.quickcommandInfo);
@ -354,8 +354,8 @@ export default {
// //
runCurrentCommand() { runCurrentCommand() {
let command = _.cloneDeep(this.quickcommandInfo); let command = _.cloneDeep(this.quickcommandInfo);
command.output = this.$refs.menu?.currentCommand.output || "text"; command.output = this.$refs.sidebar?.currentCommand.output || "text";
command.cmdType = this.$refs.menu?.cmdType.name; command.cmdType = this.$refs.sidebar?.cmdType.name;
this.$refs.result.runCurrentCommand(command); this.$refs.result.runCurrentCommand(command);
}, },
}, },

View File

@ -275,7 +275,7 @@ export default {
canCommandSave: Boolean, canCommandSave: Boolean,
}, },
mounted() { mounted() {
window.CommandMenu = this; window.CommandSideBar = this;
}, },
computed: { computed: {
specialVarsOptions() { specialVarsOptions() {