Fixed not updating answer image; Fixed undefined on resetting image non image types
This commit is contained in:
parent
6a0d83454a
commit
c9a5192a80
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, onMounted, ref } from "vue";
|
import { computed, onMounted, ref, watch, nextTick } from "vue";
|
||||||
|
|
||||||
import { useGameCreationStore } from "@/stores/GameCreationStore";
|
import { useGameCreationStore } from "@/stores/GameCreationStore";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
|
|
@ -34,7 +34,18 @@ onMounted( () => {
|
||||||
if( imageRef.value ){
|
if( imageRef.value ){
|
||||||
imageRef.value.src = API_URL + '/game/file/' + props.answer.filename;
|
imageRef.value.src = API_URL + '/game/file/' + props.answer.filename;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.bEIndex,
|
||||||
|
( _newVal, _oldVal ) => {
|
||||||
|
nextTick( () => {
|
||||||
|
if( imageRef.value ){
|
||||||
|
imageRef.value.src = API_URL + '/game/file/' + props.answer.filename;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -92,8 +92,12 @@ watch(
|
||||||
watch(
|
watch(
|
||||||
() => props.boardEntryIndex,
|
() => props.boardEntryIndex,
|
||||||
( newVal, oldVal ) => {
|
( newVal, oldVal ) => {
|
||||||
answerImageInput.value.value = "";
|
if( answerImageInput.value ){
|
||||||
questionImageInput.value.value = "";
|
answerImageInput.value.value = "";
|
||||||
|
}
|
||||||
|
if( questionImageInput.value ){
|
||||||
|
questionImageInput.value.value = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,8 @@ function stopAudio(){
|
||||||
<div v-show="props.isAnswerRevealed">
|
<div v-show="props.isAnswerRevealed">
|
||||||
<AnswerView
|
<AnswerView
|
||||||
:answer="boardEntry.answer"
|
:answer="boardEntry.answer"
|
||||||
|
:cIndex="props.cIndex"
|
||||||
|
:bEIndex="props.bEIndex"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue