0๐
<!-- begin snippet: js hide: false console: true babel: false -->
<template>
<p v-bind:style="backgroundColorFunc(2)">Lorem ipsum</p>
</template>
<script>
export default {
data() {
return {
arrayElem: ["ใใ", "This", "pronoun"],
};
},
computed: {
backgroundColorFunc: function(index){
return {
backgroundColor: this.arrayElem[index],
};
}
};
}
</script>
- [Vuejs]-How to unmount a Vue3 component in script setup
- [Vuejs]-I cannot find the defaultLayout in VUE 3
Source:stackexchange.com