mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-08 14:34:13 +08:00
函数标签支持拖动排序
This commit is contained in:
parent
ab0ab8a7a4
commit
0094cb6c29
@ -23,7 +23,15 @@
|
|||||||
narrow-indicator
|
narrow-indicator
|
||||||
outside-arrows
|
outside-arrows
|
||||||
>
|
>
|
||||||
<template v-for="flow in subFlows" :key="flow.id">
|
<draggable
|
||||||
|
v-model="subFlows"
|
||||||
|
:animation="150"
|
||||||
|
item-key="id"
|
||||||
|
tag="div"
|
||||||
|
class="row no-wrap"
|
||||||
|
handle=".flow-tab-content"
|
||||||
|
>
|
||||||
|
<template #item="{ element: flow }">
|
||||||
<q-tab :name="flow.id" class="flow-tab" no-caps>
|
<q-tab :name="flow.id" class="flow-tab" no-caps>
|
||||||
<div class="flow-tab-content">
|
<div class="flow-tab-content">
|
||||||
<template v-if="flow.isEditing">
|
<template v-if="flow.isEditing">
|
||||||
@ -52,9 +60,10 @@
|
|||||||
@click.stop="removeFlow(flow)"
|
@click.stop="removeFlow(flow)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<q-tooltip> 双击修改名称 </q-tooltip>
|
<q-tooltip> 双击修改名称,拖动排序 </q-tooltip>
|
||||||
</q-tab>
|
</q-tab>
|
||||||
</template>
|
</template>
|
||||||
|
</draggable>
|
||||||
</q-tabs>
|
</q-tabs>
|
||||||
|
|
||||||
<q-icon dense name="add" class="add-btn" @click="addFlow" />
|
<q-icon dense name="add" class="add-btn" @click="addFlow" />
|
||||||
@ -84,18 +93,20 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { defineComponent, provide, reactive } from "vue";
|
import { defineComponent, provide, ref } from "vue";
|
||||||
import ComposerFlow from "./ComposerFlow.vue";
|
import ComposerFlow from "./ComposerFlow.vue";
|
||||||
import ComposerButtons from "./flow/ComposerButtons.vue";
|
import ComposerButtons from "./flow/ComposerButtons.vue";
|
||||||
import { generateCode } from "js/composer/generateCode";
|
import { generateCode } from "js/composer/generateCode";
|
||||||
import { findCommandByValue } from "js/composer/composerConfig";
|
import { findCommandByValue } from "js/composer/composerConfig";
|
||||||
import { generateUniqSuffix } from "js/composer/variableManager";
|
import { generateUniqSuffix } from "js/composer/variableManager";
|
||||||
|
import draggable from "vuedraggable";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "FlowTabs",
|
name: "FlowTabs",
|
||||||
components: {
|
components: {
|
||||||
ComposerFlow,
|
ComposerFlow,
|
||||||
ComposerButtons,
|
ComposerButtons,
|
||||||
|
draggable,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
showCloseButton: {
|
showCloseButton: {
|
||||||
@ -104,9 +115,9 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
const subFlows = reactive([]);
|
const subFlows = ref([]);
|
||||||
const getCurrentFunctions = () => {
|
const getCurrentFunctions = () => {
|
||||||
return subFlows.map((flow) => {
|
return subFlows.value.map((flow) => {
|
||||||
return {
|
return {
|
||||||
label: flow.label,
|
label: flow.label,
|
||||||
value: flow.name,
|
value: flow.name,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user