【发布时间】:2021-10-13 12:32:43
【问题描述】:
const question = ref(false)
const changeQuestion = ref(false)
const changeQuestionButton = computed(() => {
if (!changeQuestion.value) {
return ['item.qimage']
} else {
return ['item.aimage']
}
})
<a @click="question = true" class="card-footer-item">Question</a>
<V-Modal
:open="question"
:title="item.name"
size="big"
actions="center"
@close="question = false"
>
<template #title>
<h3>{{ item.name }}</h3>
</template>
<template #content>
<img :src="changeQuestion" />
</template>
<template #action>
<V-Button raised>Question</V-Button>
<V-Button
color="primary"
@click="changeQuestionButton = true"
raised
>Answer</V-Button
>
</template>
</V-Modal>
默认情况下,模式应显示“item.qimage”。单击“答案”按钮后,它应该将图像更改为“item.aimage”。
目前它没有显示任何图像。我做错了什么?
【问题讨论】:
-
我认为您在模板中混淆了
changeQuestion和changeQuestionButton