|
@@ -212,20 +212,23 @@ export default {
|
|
|
this.question =
|
|
|
question.questionUnitList[currentExamQuestion.subNumber - 1];
|
|
|
|
|
|
+ // 对于某些图片套题,会导致高度计算错误,需多次nextTick
|
|
|
this.$nextTick(() => {
|
|
|
- // 从非套题进入套题时,会根据套题的内容动态调整套题的默认高度
|
|
|
- const parentQuestion = document.getElementsByClassName(
|
|
|
- "parent-question"
|
|
|
- )[0];
|
|
|
- if (parentQuestion) {
|
|
|
- this.parentPaneHeight =
|
|
|
- 5 +
|
|
|
- (100 * parentQuestion.clientHeight) /
|
|
|
- (document.body.clientHeight - 160);
|
|
|
- if (this.parentPaneHeight > 60) {
|
|
|
- this.parentPaneHeight = 60;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ // 从非套题进入套题时,会根据套题的内容动态调整套题的默认高度
|
|
|
+ const parentQuestion = document.getElementsByClassName(
|
|
|
+ "parent-question"
|
|
|
+ )[0];
|
|
|
+ if (parentQuestion) {
|
|
|
+ this.parentPaneHeight =
|
|
|
+ 5 +
|
|
|
+ (100 * parentQuestion.clientHeight) /
|
|
|
+ (document.body.clientHeight - 160);
|
|
|
+ if (this.parentPaneHeight > 60) {
|
|
|
+ this.parentPaneHeight = 60;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ });
|
|
|
});
|
|
|
{
|
|
|
// cache next question content
|