From 58386fd28cf3272e5c764b72b09a6023d14fb06b Mon Sep 17 00:00:00 2001 From: Frost-ZX <30585462+Frost-ZX@users.noreply.github.com> Date: Thu, 17 Mar 2022 13:09:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 522 +++---- src/assets/js/navTools.js | 30 +- src/assets/js/utils.js | 10 +- src/components/FloatingBtn.vue | 350 ++--- src/components/IconElement.vue | 106 +- src/components/Tools/GenRandomStr.vue | 306 +++-- src/components/Tools/OtherNewWindow.vue | 138 +- src/components/Tools/OtherRunJS.vue | 298 ++-- src/views/AboutView.vue | 154 +-- src/views/HomeView.vue | 1646 +++++++++++------------ src/views/SettingsView.vue | 224 +-- src/views/ToolsDetail.vue | 14 +- src/views/ToolsView.vue | 20 +- 13 files changed, 1931 insertions(+), 1887 deletions(-) diff --git a/src/App.vue b/src/App.vue index 35a5bc5..6fe69a6 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,307 +1,321 @@ diff --git a/src/assets/js/navTools.js b/src/assets/js/navTools.js index aa23021..3fa4266 100644 --- a/src/assets/js/navTools.js +++ b/src/assets/js/navTools.js @@ -1,24 +1,30 @@ -// 工具信息列表 -let navTools = { - // 分类 +/** + * @typedef {object} ToolItem + * @property {string} title 工具标题 + * @property {string} [desc] 工具简介 + * @property {string} component 组件名称 + * @property {string} [update] 更新日期 + * @property {string} [version] 版本号 + * @property {boolean} enabled 启用状态 + */ + +/** + * @typedef {object} ToolCategory + * @property {string} title 分类标题 + * @property {Object.} list 工具列表 + */ + +/** @type {Object.} */ +const navTools = { calculation: { - // 分类标题 title: '计算', - // 分类列表 list: { - // 工具 'download-time': { - // 工具标题 title: '下载用时计算', - // 工具简介 desc: '根据设定的文件大小和下载速度简单计算大约下载完成所需的时间。', - // 组件名称 component: 'CalcDownloadTime', - // 更新时间 update: '2021-12-06', - // 版本 version: '1', - // 启用状态 enabled: true }, 'ratio': { diff --git a/src/assets/js/utils.js b/src/assets/js/utils.js index 1a73e7e..b842c25 100644 --- a/src/assets/js/utils.js +++ b/src/assets/js/utils.js @@ -5,8 +5,7 @@ class Utils { constructor() { } /** - * 改变网页标题 - * + * @description 改变网页标题 * @param {string} [value] 新的标题 */ changeTitle(value) { @@ -14,8 +13,7 @@ class Utils { } /** - * JSONP - * + * @description JSONP * @param {object} options 配置选项 */ jsonp(options) { @@ -40,11 +38,9 @@ class Utils { } /** - * 以文本方式读取文件(异步) - * + * @description 以文本方式读取文件(异步) * @param {Event} ev 输入框 change 事件对象 * @param {boolean} resetValue 是否自动重置输入框 value 属性 - * * @returns {Promise} `{ name: 文件名, content: 文件内容 }` */ readFileAsText(ev, resetValue) { diff --git a/src/components/FloatingBtn.vue b/src/components/FloatingBtn.vue index 8bc6c61..b2e9b65 100644 --- a/src/components/FloatingBtn.vue +++ b/src/components/FloatingBtn.vue @@ -1,214 +1,214 @@ diff --git a/src/components/IconElement.vue b/src/components/IconElement.vue index aeda200..e3226c3 100644 --- a/src/components/IconElement.vue +++ b/src/components/IconElement.vue @@ -1,67 +1,67 @@ diff --git a/src/components/Tools/GenRandomStr.vue b/src/components/Tools/GenRandomStr.vue index 12c4479..c591d48 100644 --- a/src/components/Tools/GenRandomStr.vue +++ b/src/components/Tools/GenRandomStr.vue @@ -1,164 +1,190 @@ diff --git a/src/components/Tools/OtherNewWindow.vue b/src/components/Tools/OtherNewWindow.vue index c060009..1adc59f 100644 --- a/src/components/Tools/OtherNewWindow.vue +++ b/src/components/Tools/OtherNewWindow.vue @@ -1,93 +1,93 @@ diff --git a/src/components/Tools/OtherRunJS.vue b/src/components/Tools/OtherRunJS.vue index 53f1be4..1f2a17d 100644 --- a/src/components/Tools/OtherRunJS.vue +++ b/src/components/Tools/OtherRunJS.vue @@ -1,34 +1,36 @@ diff --git a/src/views/AboutView.vue b/src/views/AboutView.vue index f4b1b5e..c44142a 100644 --- a/src/views/AboutView.vue +++ b/src/views/AboutView.vue @@ -1,95 +1,95 @@ diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 86aad73..00ba25a 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -1,906 +1,906 @@ diff --git a/src/views/SettingsView.vue b/src/views/SettingsView.vue index 35a183a..eb17d64 100644 --- a/src/views/SettingsView.vue +++ b/src/views/SettingsView.vue @@ -1,141 +1,141 @@ diff --git a/src/views/ToolsDetail.vue b/src/views/ToolsDetail.vue index 75e5def..43219e2 100644 --- a/src/views/ToolsDetail.vue +++ b/src/views/ToolsDetail.vue @@ -9,13 +9,6 @@ import navTools from '@/assets/js/navTools.js'; export default { name: 'ToolsDetail', - data() { - return { - utils: this.$root.utils, - toolList: navTools, - toolPage: null, - } - }, beforeRouteEnter(to, from, next) { next(vm => { const { params, query } = vm.$route; @@ -52,6 +45,13 @@ export default { }); }); }, + data() { + return { + utils: this.$root.utils, + toolList: navTools, + toolPage: null, + } + }, } diff --git a/src/views/ToolsView.vue b/src/views/ToolsView.vue index bfb5ac7..76c1bac 100644 --- a/src/views/ToolsView.vue +++ b/src/views/ToolsView.vue @@ -61,16 +61,6 @@ import navTools from '@/assets/js/navTools.js'; export default { name: 'ToolsView', - data() { - return { - utils: this.$root.utils, - toolList: navTools, - detail: { - show: false, - title: '' - }, - } - }, beforeRouteEnter(to, from, next) { next(vm => { const { name: rName, params: rParams } = vm.$route; @@ -85,6 +75,16 @@ export default { } }); }, + data() { + return { + utils: this.$root.utils, + toolList: navTools, + detail: { + show: false, + title: '' + }, + } + }, methods: { /**