How to avoid adding class="" to the last element of a Vue.js loop
P粉868586032
2023-08-29 14:28:06
<p>In vuejs template, remove tailwind class when looping the last iteration of index. </p>
<p><strong>In template</strong></p>
<pre class="brush:php;toolbar:false;">v-for="(service, index) in getAllServices.home_page_services" :key="index"</pre>
<p><strong>In script</strong></p>
<pre class="brush:php;toolbar:false;"><script>
export default {
mounted() {
this.$store.dispatch("getHomePageContent")
},
computed: {
getAllServices(){
return this.$store.getters.getContentFormGetters
}
}
}</pre></p>
i can solve it