Vue中使用API​​內容渲染的彈出清單的開啟方式
P粉212971745
P粉212971745 2023-08-28 19:21:43
0
1
354
<p>我正在嘗試在渲染的清單中使用來自API請求的自訂內容打開彈出視窗。 </p> <p>目前,我有以下程式碼:</p> <pre class="brush:php;toolbar:false;"><template> <div class="biblio__all"> <a v-for="i in items" v-bind:key="i.id" class="biblio__item"> <div class="biblio__text"> <h3 class="biblio__title">{{ i.gsx$titre.$t }}</h3> <p class="biblio__author">{{ i.gsx$auteur.$t }}</p> </div> </a> <div class="hidden">這裡放彈出視窗的內容</div> </div> </template> <script lang="ts"> import { defineComponent } from "vue"; export default defineComponent({ data () { return{ items: [], } }, created(){ this.axios.get("///API URL") .then(response => (this.items = response.data.feed.entry)) }, methods: { } }) </script></pre> <p>我希望在v-for中有另一個隱藏的div,當我點擊連結時,彈出視窗出現。 </p> <p>我在items數組中有彈出視窗的所有資料。 </p>
P粉212971745
P粉212971745

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!