组件改名

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

View File

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