批量启用禁用

This commit is contained in:
fofolee 2022-04-03 21:18:50 +08:00
parent ec82130469
commit fcc83a0955
2 changed files with 16 additions and 16 deletions

View File

@ -1,6 +1,10 @@
<template>
<!-- mini 模式下如果命令未启用或者不可直接运行则隐藏卡片面板 -->
<div class="wrapper" v-show="!cardStyleVars.hideCard">
<div
class="wrapper"
v-show="!cardStyleVars.hideCard"
:id="commandInfo.features.code"
>
<div>
<!-- mini 模式下不显示各类按钮 -->
<div v-show="cardStyleVars.showButtons">
@ -10,6 +14,7 @@
v-model="isCommandActivated"
checked-icon="flash_on"
color="orange-6"
@click="toggleCommandActivated"
/>
</div>
<!-- 选项按钮 -->
@ -175,7 +180,6 @@
</template>
<script>
export default {
data() {
return {
@ -192,11 +196,6 @@ export default {
},
};
},
watch: {
isCommandActivated() {
this.toggleCommandActivated();
},
},
computed: {
//
cardStyleVars() {
@ -238,7 +237,7 @@ export default {
cardStyle: Object,
},
mounted() {
console.log(this.commandInfo.features.code, this);
// console.log(this.commandInfo.features.code, this);
},
methods: {
//

View File

@ -67,7 +67,6 @@
<CommandCard
v-for="commandInfo in currentTagQuickCommands"
:key="commandInfo.features.code"
:ref="commandInfo.features.code"
:commandInfo="commandInfo"
:activated="
activatedQuickCommandFeatureCodes.includes(
@ -494,7 +493,7 @@ export default {
this.currentTag = !tags || !tags.length ? "未分类" : tags[0];
// dom
this.$nextTick(() => {
this.$refs[code][0].$el.nextElementSibling.scrollIntoViewIfNeeded();
document.getElementById(code).scrollIntoViewIfNeeded();
});
},
//
@ -569,15 +568,17 @@ export default {
},
//
enableAllCommands() {
for (var key in this.$refs) {
this.$refs[key][0].isCommandActivated = true;
}
// dom
document
.querySelectorAll(".q-toggle[aria-checked='false']")
.forEach((x) => x.click());
},
//
disableAllCommands() {
for (var key in this.$refs) {
this.$refs[key][0].isCommandActivated = false;
}
// dom
document
.querySelectorAll(".q-toggle[aria-checked='true']")
.forEach((x) => x.click());
},
},
};