|
@@ -20,7 +20,7 @@ import {
|
|
|
showToast,
|
|
|
Tag
|
|
|
} from 'vant'
|
|
|
-import { defineComponent, onMounted, reactive } from 'vue'
|
|
|
+import { defineComponent, onMounted, onUnmounted, reactive } from 'vue'
|
|
|
import styles from './index.module.less'
|
|
|
import iconSaveImage from '@/school/orchestra/images/icon-save-image.png'
|
|
|
import iconWechat from '@/school/orchestra/images/icon-wechat.png'
|
|
@@ -162,6 +162,18 @@ export default defineComponent({
|
|
|
onMounted(async () => {
|
|
|
getSubjects()
|
|
|
getList()
|
|
|
+
|
|
|
+ // 处理返回上一页的问题
|
|
|
+ window.history.pushState(null, '', document.URL)
|
|
|
+ window.addEventListener('popstate', onBack, false)
|
|
|
+ })
|
|
|
+
|
|
|
+ const onBack = () => {
|
|
|
+ postMessage({ api: 'back' })
|
|
|
+ }
|
|
|
+
|
|
|
+ onUnmounted(() => {
|
|
|
+ window.removeEventListener('popstate', onBack)
|
|
|
})
|
|
|
return () => (
|
|
|
<div class={!form.listState.dataShow && 'emptyRootContainer'}>
|