mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-09-02 12:15:18 +08:00
菜单组件和命令结果组件异步加载
This commit is contained in:
parent
5f00c125d9
commit
6ecf292581
@ -231,7 +231,7 @@ import CommandSideBar from "components/CommandSideBar";
|
|||||||
import CommandRunResult from "components/CommandRunResult";
|
import CommandRunResult from "components/CommandRunResult";
|
||||||
import QuickAction from "components/popup/QuickAction";
|
import QuickAction from "components/popup/QuickAction";
|
||||||
import KeyRecorder from "components/popup/KeyRecorder";
|
import KeyRecorder from "components/popup/KeyRecorder";
|
||||||
// Monaco改用异步加载
|
// Performance Scripting > 500ms
|
||||||
const MonacoEditor = defineAsyncComponent(() =>
|
const MonacoEditor = defineAsyncComponent(() =>
|
||||||
import("components/MonacoEditor")
|
import("components/MonacoEditor")
|
||||||
);
|
);
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex">
|
|
||||||
<q-btn stretch color="primary" flat size="xs"
|
|
||||||
><q-spinner-bars color="primary" size="1.5em" />
|
|
||||||
<q-menu
|
<q-menu
|
||||||
max-height="480px"
|
max-height="480px"
|
||||||
max-width="300px"
|
max-width="300px"
|
||||||
@ -37,7 +34,10 @@
|
|||||||
style="width: 280px"
|
style="width: 280px"
|
||||||
autofocus
|
autofocus
|
||||||
v-model="$root.profile.quickFileTag"
|
v-model="$root.profile.quickFileTag"
|
||||||
@blur="$root.profile.quickFileTag || ($root.profile.quickFileTag = '文件')"
|
@blur="
|
||||||
|
$root.profile.quickFileTag ||
|
||||||
|
($root.profile.quickFileTag = '文件')
|
||||||
|
"
|
||||||
type="text"
|
type="text"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
@ -69,8 +69,10 @@
|
|||||||
input-class="text-center"
|
input-class="text-center"
|
||||||
style="width: 280px"
|
style="width: 280px"
|
||||||
v-model="$root.profile.quickUrlTag"
|
v-model="$root.profile.quickUrlTag"
|
||||||
@blur="$root.profile.quickUrlTag || ($root.profile.quickUrlTag = '网址')"
|
@blur="
|
||||||
|
$root.profile.quickUrlTag ||
|
||||||
|
($root.profile.quickUrlTag = '网址')
|
||||||
|
"
|
||||||
type="text"
|
type="text"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
@ -129,10 +131,7 @@
|
|||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-field dense outlined style="width: 280px">
|
<q-field dense outlined style="width: 280px">
|
||||||
<template v-slot:control>
|
<template v-slot:control>
|
||||||
<div
|
<div class="self-center full-width no-outline" tabindex="0">
|
||||||
class="self-center full-width no-outline"
|
|
||||||
tabindex="0"
|
|
||||||
>
|
|
||||||
快捷命令服务
|
快捷命令服务
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -159,10 +158,7 @@
|
|||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-field dense outlined style="width: 280px">
|
<q-field dense outlined style="width: 280px">
|
||||||
<template v-slot:control>
|
<template v-slot:control>
|
||||||
<div
|
<div class="self-center full-width no-outline" tabindex="0">
|
||||||
class="self-center full-width no-outline"
|
|
||||||
tabindex="0"
|
|
||||||
>
|
|
||||||
运行代码
|
运行代码
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -371,9 +367,7 @@
|
|||||||
<q-icon name="label" />
|
<q-icon name="label" />
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section class="flex">紧凑标签栏 </q-item-section>
|
<q-item-section class="flex">紧凑标签栏 </q-item-section>
|
||||||
<q-tooltip
|
<q-tooltip>更为紧凑的标签栏,适用于标签非常多的情形</q-tooltip>
|
||||||
>更为紧凑的标签栏,适用于标签非常多的情形</q-tooltip
|
|
||||||
>
|
|
||||||
<q-item-section side
|
<q-item-section side
|
||||||
><q-toggle
|
><q-toggle
|
||||||
v-model="$root.profile.denseTagBar"
|
v-model="$root.profile.denseTagBar"
|
||||||
@ -403,35 +397,32 @@
|
|||||||
<q-item-section>分享中心</q-item-section>
|
<q-item-section>分享中心</q-item-section>
|
||||||
</q-item> -->
|
</q-item> -->
|
||||||
<!-- 收藏 -->
|
<!-- 收藏 -->
|
||||||
<q-item v-if="isTagStared" clickable @click="unMarkTag" v-close-popup>
|
<q-item v-if="isTagStared" clickable @click="unMarkTag">
|
||||||
<q-item-section side>
|
<q-item-section side>
|
||||||
<q-icon name="star_border" />
|
<q-icon name="star_border" />
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section>取消收藏</q-item-section>
|
<q-item-section>取消收藏</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item v-else clickable @click="showPanelConf = true" v-close-popup>
|
<q-item v-else clickable @click="showPanelConf = true">
|
||||||
<q-item-section side>
|
<q-item-section side>
|
||||||
<q-icon name="star" />
|
<q-icon name="star" />
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section>收藏标签</q-item-section>
|
<q-item-section>收藏标签</q-item-section>
|
||||||
<q-tooltip
|
<q-tooltip
|
||||||
>收藏后,会将当前标签名作为全局关键字,可在 uTools
|
>收藏后,会将当前标签名作为全局关键字,可在 uTools 的主输入框进行搜索
|
||||||
的主输入框进行搜索
|
|
||||||
<br />
|
<br />
|
||||||
搜索进入后,默认进入当前标签的面板视图 <br />
|
搜索进入后,默认进入当前标签的面板视图 <br />
|
||||||
类似于旧版本的「快捷面板」</q-tooltip
|
类似于旧版本的「快捷面板」</q-tooltip
|
||||||
>
|
>
|
||||||
</q-item>
|
</q-item>
|
||||||
<!-- 关于 -->
|
<!-- 关于 -->
|
||||||
<q-item clickable @click="showAbout = true" v-close-popup>
|
<q-item clickable @click="showAbout = true">
|
||||||
<q-item-section side>
|
<q-item-section side>
|
||||||
<q-icon name="info" />
|
<q-icon name="info" />
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section>关于和帮助</q-item-section></q-item
|
<q-item-section>关于和帮助</q-item-section></q-item
|
||||||
>
|
>
|
||||||
</q-list>
|
</q-list>
|
||||||
</q-menu>
|
|
||||||
</q-btn>
|
|
||||||
<!-- 关于弹窗 -->
|
<!-- 关于弹窗 -->
|
||||||
<q-dialog v-model="showAbout">
|
<q-dialog v-model="showAbout">
|
||||||
<AboutThis />
|
<AboutThis />
|
||||||
@ -443,7 +434,7 @@
|
|||||||
<q-dialog v-model="showUserDara">
|
<q-dialog v-model="showUserDara">
|
||||||
<UserData :showInsertBtn="false" />
|
<UserData :showInsertBtn="false" />
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
</div>
|
</q-menu>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -167,14 +167,21 @@
|
|||||||
icon="add"
|
icon="add"
|
||||||
/>
|
/>
|
||||||
<q-separator vertical />
|
<q-separator vertical />
|
||||||
<!-- 下拉菜单 -->
|
<q-btn
|
||||||
<ConfigurationMenu
|
stretch
|
||||||
|
color="primary"
|
||||||
|
flat
|
||||||
|
size="xs"
|
||||||
:style="{
|
:style="{
|
||||||
height: footerBarHeight,
|
height: footerBarHeight,
|
||||||
}"
|
}"
|
||||||
|
><q-spinner-bars color="primary" size="1.5em" />
|
||||||
|
<!-- 菜单 -->
|
||||||
|
<ConfigurationMenu
|
||||||
:isTagStared="activatedQuickPanels.includes(currentTag)"
|
:isTagStared="activatedQuickPanels.includes(currentTag)"
|
||||||
:currentTag="currentTag"
|
:currentTag="currentTag"
|
||||||
></ConfigurationMenu>
|
></ConfigurationMenu>
|
||||||
|
</q-btn>
|
||||||
</q-btn-group>
|
</q-btn-group>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -202,13 +209,19 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { defineAsyncComponent } from "vue";
|
||||||
import quickcommandParser from "../js/common/quickcommandParser.js";
|
import quickcommandParser from "../js/common/quickcommandParser.js";
|
||||||
import CommandCard from "components/CommandCard";
|
|
||||||
import ConfigurationMenu from "components/ConfigurationMenu.vue";
|
|
||||||
import CommandRunResult from "components/CommandRunResult.vue";
|
|
||||||
import importAll from "../js/common/importAll.js";
|
import importAll from "../js/common/importAll.js";
|
||||||
import pinyinMatch from "pinyin-match";
|
import pinyinMatch from "pinyin-match";
|
||||||
|
import CommandCard from "components/CommandCard";
|
||||||
import CommandEditor from "components/CommandEditor";
|
import CommandEditor from "components/CommandEditor";
|
||||||
|
const CommandRunResult = defineAsyncComponent(() =>
|
||||||
|
import("components/CommandRunResult.vue")
|
||||||
|
);
|
||||||
|
// Performance Rendering > 300ms
|
||||||
|
const ConfigurationMenu = defineAsyncComponent(() =>
|
||||||
|
import("components/ConfigurationMenu.vue")
|
||||||
|
);
|
||||||
|
|
||||||
// 默认命令
|
// 默认命令
|
||||||
let defaultCommands = importAll(require.context("../json/", false, /\.json$/));
|
let defaultCommands = importAll(require.context("../json/", false, /\.json$/));
|
||||||
@ -216,8 +229,8 @@ let defaultCommands = importAll(require.context("../json/", false, /\.json$/));
|
|||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
CommandCard,
|
CommandCard,
|
||||||
ConfigurationMenu,
|
|
||||||
CommandEditor,
|
CommandEditor,
|
||||||
|
ConfigurationMenu,
|
||||||
CommandRunResult,
|
CommandRunResult,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user