我有一个像这样的 vue 应用程序
<template>
<div class="text-center">
<table class="table">
<thead>
<tr>
<th scope="col">پاسخ</th>
<th scope="col">سؤال</th>
<th scope="col">شماره سؤال</th>
</tr>
</thead>
<tbody>
<tr v-for="question in this.questions" :key="question.id-1">
<th scope="row"><input class="form-check-input" type="checkbox" /></th>
<td>{{question.question_text}}</td>
<td>{{question.id-1}}</td>
</tr>
</tbody>
</table>
<button type="submit" class="btn btn-primary m-5" @click="handlsubmit">ثبت پاسخ</button>
</div>
</template>
<script>
export default {
name: "InitialTest",
data() {
return {
questions: this.$store.state.diagnosis.question
};
},
beforeCreate() {
this.$store.dispatch("diagnosis/insertQuestion");
}
第一次加载的时候没问题,但是当我刷新页面时,请求被调用但是组件没有加载