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>
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import { computed, onMounted, ref, watch, nextTick } from "vue";
|
||||
|
||||
import { useGameCreationStore } from "@/stores/GameCreationStore";
|
||||
import { useRoute } from "vue-router";
|
||||
|
|
@ -34,7 +34,18 @@ onMounted( () => {
|
|||
if( imageRef.value ){
|
||||
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>
|
||||
|
||||
|
|
|
|||
|
|
@ -92,8 +92,12 @@ watch(
|
|||
watch(
|
||||
() => props.boardEntryIndex,
|
||||
( newVal, oldVal ) => {
|
||||
answerImageInput.value.value = "";
|
||||
questionImageInput.value.value = "";
|
||||
if( answerImageInput.value ){
|
||||
answerImageInput.value.value = "";
|
||||
}
|
||||
if( questionImageInput.value ){
|
||||
questionImageInput.value.value = "";
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -91,6 +91,8 @@ function stopAudio(){
|
|||
<div v-show="props.isAnswerRevealed">
|
||||
<AnswerView
|
||||
:answer="boardEntry.answer"
|
||||
:cIndex="props.cIndex"
|
||||
:bEIndex="props.bEIndex"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue