解决:在onUpdated中实现swiper配置
(原来在Vue2中是在mounted配置的)
vue3
//vue3
setup(){
//省略。。。。。
onUpdated(()=>{
var swiper = new Swiper("#musicSwiper", {
pagination: {
el: ".swiper-pagination",
clickable: true,
},
});
})
return{
}
}
vue2
data:function(){
return{
}
},
async mounted(){
var swiper = new Swiper("#musicSwiper", {
pagination: {
el: ".swiper-pagination",
clickable: true,
},
});
}