IView中更新Carousel 的数据,点击按钮出错

帅动的笑脸
  • 17

in .Vue,

data(){
    appData:[
            {
                imgs: "https://res.o2o.cn/img/d7533bfc5301434393206aaef42238ed.jpg",
                bannerText: "banner文字描述111"
            },
            {
                imgs: "https://res.o2o.cn/img/6ce06311a47d49a6893280f7242fe8f8.jpg",
                bannerText: "banner文字描述222"
            },
            {
                imgs: "https://res.o2o.cn/img/31454866799d4611948d468a2f7c416a.jpg",
                bannerText: "banner文字描述333"
            }
         ]
}

the template:

 <Carousel v-model="value3"
            :autoplay="true">
    <CarouselItem v-for="item in appData"
        :key="item.imgs">
        ...
            <img :src="item.imgs" />
        ...
    </CarouselItem>
</Carousel>

after a time,i would like to change the 'appData':

[{"imgs":"https://res.o2o.cn/img/e554db4979424c34a61502479e766e94.jpg","bannerText":"轮播图2","url":"购物车"},{"imgs":"https://res.o2o.cn/img/d85d9d6b6eab4b51a525088125a50651.jpg","bannerText":"轮播图1","url":"直播"}]

The Carousel seems doing right.
But when i click the button(radius-dot or arrow-button),the three page show.

回复
阅读 1.6k
1 个回答

我找到问题了,我自己在其他地方 合并了数据

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏