在vuejs模板中,当循环索引的最后一次迭代时,删除tailwind类。
在模板中
v-for="(service, index) in getAllServices.home_page_services" :key="index"
在脚本中
<script>
export default {
mounted() {
this.$store.dispatch("getHomePageContent")
},
computed: {
getAllServices(){
return this.$store.getters.getContentFormGetters
}
}
} Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
i can solve it
:class="{ 'lg:border-r-2 lg:border-blue-650': index < getAllServices.home_page_services.length - 1 }"