computed: {
returnSomething: function () {
return this.something
}
}
export default {
computed:{
test(){
return this.course.image
}
}
,
props:['course'],
}
var vm = new Vue({
el: '#example',
data: {
message: 'Hello'
},
computed: {
// a computed getter
reversedMessage: function () {
// `this` points to the vm instance
return this.message.split('').reverse().join('')
}
}
})
// Vue 3 (Computed getter and setter) in script setup.
const view = ref(false)
const computedView = computed({
get: () => view.value,
set: val => {
view.value = val
}
})