ホームページ  >  に質問  >  本文

Vue.js ループの最後の要素に class="" を追加しないようにする方法

<p>vuejs テンプレートで、インデックスの最後の反復をループするときに tailwind クラスを削除します。 </p> <p><strong>テンプレート内</strong></p> <pre class="brush:php;toolbar:false;">v-for="(サービス, インデックス) in getAllServices.home_page_services" :key="index"</pre> <p><strong>スクリプト内</strong></p> <pre class="brush:php;toolbar:false;"><script> デフォルトのエクスポート { マウントされた() { this.$store.dispatch("getHomePageContent") }、 計算結果: { getAllServices(){ this.$store.getters.getContentFormGetters を返します } } }</pre></p>
P粉868586032P粉868586032416日前472

全員に返信(1)返信します

  • P粉949848849

    P粉9498488492023-08-30 10:00:49

    i can solve it

    :class="{ 'lg:border-r-2 lg:border-blue-650': index < getAllServices.home_page_services.length - 1 }"

    返事
    0
  • キャンセル返事