-
-
-
-
+
\ No newline at end of file
+
diff --git a/src/pages/setting/Setting.vue b/src/pages/setting/Setting.vue
index a52fe324..19f13689 100644
--- a/src/pages/setting/Setting.vue
+++ b/src/pages/setting/Setting.vue
@@ -211,12 +211,21 @@ function importJson(str: string, notice: boolean = true) {
}
}
-async function importData(e) {
+let timer = -1
+async function beforeImport() {
importLoading = true
await exportData('已自动备份数据', 'TypeWords数据备份.zip')
await sleep(1500)
+ let d: HTMLDivElement = document.querySelector('#import')
+ d.click()
+ timer = setTimeout(()=>importLoading = false, 1000)
+}
+
+async function importData(e) {
+ clearTimeout(timer)
+ importLoading = true
let file = e.target.files[0]
- if (!file) return
+ if (!file) return importLoading = false
if (file.name.endsWith(".json")) {
let reader = new FileReader();
reader.onload = function (v) {
@@ -373,12 +382,13 @@ function transferOk() {
请注意,导入数据将 完全覆盖 当前所有数据,请谨慎操作。执行导入操作时,会先自动备份当前数据到您的电脑中,供您随时恢复
@@ -527,18 +537,6 @@ function transferOk() {
}
}
-.import {
- display: inline-flex;
- position: relative;
-
- input {
- position: absolute;
- height: 100%;
- width: 100%;
- opacity: 0;
- }
-}
-
// 移动端适配
@media (max-width: 768px) {
.setting {
diff --git a/src/pages/word/DictDetail.vue b/src/pages/word/DictDetail.vue
index 07e1e621..1a52a9f4 100644
--- a/src/pages/word/DictDetail.vue
+++ b/src/pages/word/DictDetail.vue
@@ -1,13 +1,31 @@