Level 63
Well ... you have to assign the new value to the thing data.
dropSelect(thing: any) {
this.thing = thing;
}
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
The following code does not update the interpolation on click. It will console log the change but nothing else. What am I doing wrong?
<template>
<div class="container-xl pb-5">
<button class="mb-2 btn-lg selected-dropdown" @click="dropSelect('B')">
{{ thing }}
</button>
</div>
</template>
<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
data() {
return {
thing: "A",
};
},
methods: {
dropSelect(thing: any) {
console.log(thing);
return this.thing;
},
},
});
</script>
Please or to participate in this conversation.