Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swiper无法正常使用 #60

Closed
nyrf opened this issue Mar 26, 2016 · 5 comments
Closed

Swiper无法正常使用 #60

nyrf opened this issue Mar 26, 2016 · 5 comments

Comments

@nyrf
Copy link

nyrf commented Mar 26, 2016

如果按demo中直接写list倒还可以工作,换成动态list就不行了

<template>
  <div>
    <swiper :list="list"></swiper>
  <div>
</template>

<script>
import Swiper from 'vux/components/swiper/'
export default {
  components: {
    Swiper
  },

  data () {
    return {
      isLoading: false,
      list: []
    }
  },

  ready () {
    this.list =  [{
        url: 'http://mp.weixin.qq.com/s?__biz=MzAxNjU0MDYxMg==&ampmid=400385458&ampidx=1&ampsn=78f6b8d99715384bdcc7746596d88359&ampscene=19#wechat_redirect',
        img: 'http://7xqzw4.com2.z0.glb.qiniucdn.com/1.jpg',
        title: '如何手制一份秋意的茶?'
      }, {
        url: 'http://mp.weixin.qq.com/s?__biz=MzAxNjU0MDYxMg==&ampmid=400160890&ampidx=1&ampsn=29ef02af25793a11a3f6aec92bfb46c1&ampscene=19#wechat_redirect',
        img: 'http://7xqzw4.com2.z0.glb.qiniucdn.com/2.jpg',
        title: '茶包VS原叶茶'
      }, {
        url: 'http://mp.weixin.qq.com/s?__biz=MzAxNjU0MDYxMg==&ampmid=400094682&ampidx=1&ampsn=8231a2053b772b2108784fccc254d28c&ampscene=19#wechat_redirect',
        img: 'http://7xqzw4.com2.z0.glb.qiniucdn.com/3.jpg',
        title: '播下茶籽,明春可发芽?'
      }]
  }
}
</script>

或者使用ajax加载对list对行赋值,也不能工作,图片无法显示,但用list.length, 是显示长度正确的

@airyland
Copy link
Owner

目前应该是一次性渲染,动态绑定下个版本支持。

@nyrf
Copy link
Author

nyrf commented Mar 26, 2016

@airyland 谢谢,看来得想办法改一下了

@laoxubuer
Copy link

@nyrf 在list里面初始化一个{}就可以运行了...

@JianleiZhang
Copy link

空的{}会产生一个BUG,默认会去请求一张图片地址为:http://当前域名/undefined

@YangGoldDragon
Copy link

好奇怪的组件,居然不支持动态数据,醉了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants