fix:作答刷新页面

This commit is contained in:
王博冉
2023-09-06 14:51:17 +08:00
parent 542cb1e72f
commit 7762336de2
2 changed files with 14 additions and 1 deletions

View File

@@ -453,7 +453,6 @@ const constantRoutes = [
export const asyncRoutes = []
const router = createRouter({
mode: 'history',
history: createWebHashHistory(),
routes: constantRoutes
})

View File

@@ -38,6 +38,7 @@ import QBPTO from "../../questions/high/QBPTO.vue";
import QMXD from "../../questions/high/QMXD.vue";
import QNPS from "../../questions/high/QNPS.vue";
import answerMock from "./mock";
import { useRoute } from "vue-router";
export default defineComponent({
components: {
@@ -91,6 +92,7 @@ export default defineComponent({
},
},
setup(props) {
const route = useRoute();
const page = ref(0); // 当前页数
const questionsData = inject("questionsData"); // 问卷数据
const startAnswerTime = new Date().getTime(); // 开始答题时间戳
@@ -786,6 +788,18 @@ export default defineComponent({
}
}
watch(
route.query.sn,
(sn) => {
if(sn) {
window.location.reload()
}
},
{
deep: true,
}
)
return {
page,
pages,