| | |
| | | </div> |
| | | </div> |
| | | <preView :md5="p_md5" :pdfTitle="somePdfTitleValue" ref="pdfDialogRef"></preView> |
| | | <dialogExaminations :cardList="interfaceQuestion" :questionIDList=questionIDList :page="questionNum" |
| | | <dialogExaminations :cardList="interfaceQuestion" :questionIDList="questionIDList" :page="questionNum" |
| | | :questionTitle="questionTitleMain" ref="dialogRef"> |
| | | </dialogExaminations> |
| | | </div> |
| | |
| | | }, |
| | | getResourceInfo: { |
| | | type: Function, // 明确指定它是一个函数 |
| | | required: true |
| | | required: true, |
| | | }, |
| | | interfaceQuestion: { |
| | | type: Array, |
| | | required: true, |
| | | default: () => [], |
| | | } |
| | | }, |
| | | }, |
| | | components: { |
| | | preView, |
| | | bookVideo, |
| | | dialogExaminations |
| | | dialogExaminations, |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | questionTitleMain: "", |
| | | questionIDList: [], |
| | | chapterNum: 2, |
| | | cardArrayList: [], |
| | | examinations: [ |
| | | { |
| | | questionTitleMain: "拓展练习", |
| | |
| | | questionData: { |
| | | one: "", |
| | | }, |
| | | |
| | | }; |
| | | }, |
| | | watch: { |
| | | interfaceQuestion: { |
| | | handler(newValue, oldValue) { |
| | | console.log('--- 子组件:interfaceQuestion 更新了! ---'); |
| | | console.log('新值 (newValue):', newValue); |
| | | console.log('旧值 (oldValue):', oldValue); |
| | | if (newValue && newValue.length > 0) { |
| | | |
| | | } |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | | }, |
| | | }, |
| | | |
| | | mounted() { |
| | | console.log(this.interfaceQuestion, "interfaceQuestion"); |
| | | |
| | | this.getQuestionData() |
| | | this.getQuestionData(); |
| | | }, |
| | | methods: { |
| | | |
| | | toUrl(val) { |
| | | if (val != null) { |
| | | this.p_md5 = val.md5; |
| | |
| | | ); |
| | | }, |
| | | getQuestionData() { |
| | | let questionData = localStorage.getItem("preventiveDentistry-book-chapter01-questionData"); |
| | | let questionData = localStorage.getItem( |
| | | "preventiveDentistry-book-chapter01-questionData" |
| | | ); |
| | | if (questionData) { |
| | | this.questionData = JSON.parse(questionData); |
| | | } |
| | |
| | | openQuestion(num) { |
| | | if (num != undefined) { |
| | | this.questionNum = this.examinations[num].questionNum; |
| | | console.log(this.questionNum); |
| | | this.questionTitleMain = this.examinations[num].questionTitleMain; |
| | | console.log(this.questionTitleMain); |
| | | this.cardArrayList = this.interfaceQuestion; |
| | | console.log(this.cardArrayList); |
| | | this.questionIDList = testData[this.chapterNum][this.questionNum]; |
| | | console.log(this.questionIDList); |
| | | |
| | | this.$nextTick(() => { |
| | | this.$refs.dialogRef.openDialogQuestion(); |
| | | }); |
| | | } |
| | | }, |
| | | }, |