Просмотр исходного кода

Merge branch 'master' into liua

* master:
  addEventListener pageshow
  ~
  ~
  ~
la лет назад: 2
Родитель
Сommit
6d8a516a89
6 измененных файлов с 17 добавлено и 11 удалено
  1. 0 4
      auto-imports.d.ts
  2. 2 1
      components.d.ts
  3. 1 1
      index.html
  4. 1 1
      public/dtk/assets/index.26656681.js
  5. 3 1
      src/App.vue
  6. 10 3
      src/pages/step/[id].vue

+ 0 - 4
auto-imports.d.ts

@@ -12,8 +12,6 @@ declare global {
   const $shallowRef: typeof import('vue/macros')['$shallowRef']
   const $toRef: typeof import('vue/macros')['$toRef']
   const EffectScope: typeof import('vue')['EffectScope']
-  const ElMessage: typeof import('element-plus/es')['ElMessage']
-  const ElMessageBox: typeof import('element-plus/es')['ElMessageBox']
   const asyncComputed: typeof import('@vueuse/core')['asyncComputed']
   const autoResetRef: typeof import('@vueuse/core')['autoResetRef']
   const computed: typeof import('vue')['computed']
@@ -300,8 +298,6 @@ declare module 'vue' {
     readonly $shallowRef: UnwrapRef<typeof import('vue/macros')['$shallowRef']>
     readonly $toRef: UnwrapRef<typeof import('vue/macros')['$toRef']>
     readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
-    readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']>
-    readonly ElMessageBox: UnwrapRef<typeof import('element-plus/es')['ElMessageBox']>
     readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
     readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']>
     readonly computed: UnwrapRef<typeof import('vue')['computed']>

+ 2 - 1
components.d.ts

@@ -19,6 +19,8 @@ declare module '@vue/runtime-core' {
     ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
     ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
     ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
+    ElCollapse: typeof import('element-plus/es')['ElCollapse']
+    ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
     ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
     ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
     ElDialog: typeof import('element-plus/es')['ElDialog']
@@ -49,7 +51,6 @@ declare module '@vue/runtime-core' {
     OptionSelect: typeof import('./src/components/optionSelect/index.vue')['default']
     RouterLink: typeof import('vue-router')['RouterLink']
     RouterView: typeof import('vue-router')['RouterView']
-    StatisticsSchool: typeof import('./src/components/statisticsSchool/index.vue')['default']
     Szcjckqx: typeof import('./src/components/step/link/szcjckqx.vue')['default']
     TheCard: typeof import('./src/components/TheCard.vue')['default']
     TinymceVue: typeof import('./src/components/TinymceVue/index.vue')['default']

+ 1 - 1
index.html

@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html lang="en">
+<html lang="zh-Hans">
 <head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
public/dtk/assets/index.26656681.js


+ 3 - 1
src/App.vue

@@ -2,10 +2,12 @@
 import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
 // 修改分页器默认文字
 zhCn.el.pagination.goto = '跳至'
+
+const timestamp = Date.now()
 </script>
 
 <template>
-  <el-config-provider :locale="zhCn">
+  <el-config-provider :key="timestamp" :locale="zhCn">
     <Suspense>
       <RouterView />
     </Suspense>

+ 10 - 3
src/pages/step/[id].vue

@@ -319,12 +319,19 @@ function routerPush(path: RouteLocationRaw) {
   router.push(path)
 }
 function windowPushState(path: string) {
-  // 采取如下方式主要由于chrome下history.back()不会重新load页面
+  // !未启用
   sessionStorage.setItem('historyLocation', location.href)
-  // window.open(`${location.origin}/${path}`, '_self')
-  location.replace(`${location.origin}/${path}`)
+  window.open(`${location.origin}/${path}`, '_self')
+  // location.replace(`${location.origin}/${path}`)
+  // window.history.pushState(null, '', `${location.origin}/${path}`)
 }
 
+// 采取如下方式主要由于chrome下history.back()不会重新load页面
+window.addEventListener('pageshow', (e) => {
+  if (e.persisted)
+    window.location.reload()
+})
+
 function handleValidTask(currentStep: number, idx: number, idy: number) {
   let lastIdx = idx
   let lastStep = currentStep