升级vuecli3.0页面报错
来源:12-1 Vue 3.0环境升级
zg_vera
2020-12-03
升级vuecli3.0时,按照课程把this去掉后,页面依然没有正常展示,报了这样的错
把home-swiper暂时注释掉,下面的组件会报这样的错
点击城市按钮,也报错,但是直接输入city的路由地址能正常展示页面,点击跳转不行
<template>
<div class="wrapper">
<swiper :options="swiperOption" v-if="showSwiper">
<swiper-slide v-for="item of list" :key="item.id">
<img class='swiper-img' :src="item.imgUrl" alt="">
</swiper-slide>
<div class="swiper-pagination" slot="pagination"></div>
</swiper>
</div>
</template>
<script>
export default {
name:'HomeSwiper',
props:{
list:Array,
},
data(){
return {
swiperOption: {
pagination: '.swiper-pagination',
loop:true
},
}
},
computed:{
showSwiper(){
return this.list.length
}
}
}
</script>
<style lang="stylus" scoped>
.wrapper >>>.swiper-pagination-bullet-active
background :#fff !important
.wrapper
overflow :hidden
width:100%
height:0
padding-bottom :30%
background:#eee
.swiper-img
width :100%
</style>
写回答
1回答
-
Dell
2020-12-04
swiper.vue 代码发上来看看
082020-12-12
相似问题