完善底栏按钮功能

This commit is contained in:
fofolee
2022-04-03 18:29:49 +08:00
parent 004de05078
commit 0fc83c31de
2 changed files with 129 additions and 19 deletions

View File

@@ -1,10 +1,6 @@
<template>
<!-- mini 模式下如果命令未启用或者不可直接运行则隐藏卡片面板 -->
<div
class="wrapper"
v-show="!cardStyleVars.hideCard"
:id="commandInfo.features.code"
>
<div class="wrapper" v-show="!cardStyleVars.hideCard">
<div>
<!-- mini 模式下不显示各类按钮 -->
<div v-show="cardStyleVars.showButtons">
@@ -14,7 +10,6 @@
v-model="isCommandActivated"
checked-icon="flash_on"
color="orange-6"
@click="toggleCommandActivated"
/>
</div>
<!-- 选项按钮 -->
@@ -79,7 +74,11 @@
</div>
<!-- 匹配模式 -->
<div class="row">
<div :class="'matchTypesBox flex q-gutter-xs ' + cardStyleVars.fontPosition">
<div
:class="
'matchTypesBox flex q-gutter-xs ' + cardStyleVars.fontPosition
"
>
<span v-for="cmd in commandInfo.features.cmds" :key="cmd">
<span v-if="typeof cmd === 'string'">
<q-badge rounded :color="cmdBadgeColor()"
@@ -195,6 +194,11 @@ export default {
},
};
},
watch: {
isCommandActivated() {
this.toggleCommandActivated();
},
},
computed: {
// 控制卡片样式的具体参数
cardStyleVars() {
@@ -236,7 +240,7 @@ export default {
cardStyle: Object,
},
mounted() {
console.log("CommandCard", this);
console.log(this.commandInfo.features.code, this);
},
methods: {
// 匹配类型太长的话截断