Within my Vue component, I initially set a boolean constant in the data object with a value of false. Now, I aim to create a method that will change this constant to true and conditionally bind certain elements in the template based on this change. However, I encountered an error stating “property value does not exist on type…” when attempting to access it. When I tried moving computed out of data, a different error appeared saying “Property 'computed' has no initializer”.
export default class Something extends Vue {
data() {
return {
value: false,
computed: {
valueTransform() {
this.value = true
alert(this.value)
},
},
}
}
}