wechat-miniprogram / kbone-ui

kbone-ui 是一套能同时支持 小程序(kbone) 和 vue 框架开发的多端 UI 库(PS:新版 kbone-ui 已出炉并迁移到 kbone 主仓库,此仓库仅做旧版维护之用)
https://wechat-miniprogram.github.io/kbone/docs/ui/intro/
MIT License
444 stars 45 forks source link

swiper is not working on web landscape view with MacBook trackpad #13

Closed qinwf closed 4 years ago

qinwf commented 4 years ago

screen recording:

swiper.mov.zip

example page:

swiper-on-desktop.zip

home page source code:

Index.vue.zip

vue 2.6.11, kbone-ui 0.6.2, tested on macbook pro 13-inch Chrome 79.0.3945.79

<template>
  <div class='content'>
    <k-swiper class='swiper-wrapper' indicator-dots=true>
      <k-swiper-item>
        <img src='https://loremflickr.com/320/240?lock=1'>
      </k-swiper-item>
      <k-swiper-item>
        <img src='https://loremflickr.com/320/240?lock=2'>
      </k-swiper-item>
      <k-swiper-item>
        <img src='https://loremflickr.com/320/240?lock=3'>
      </k-swiper-item>
    </k-swiper>
  </div>
</template>

<script>
import Vue from 'vue'
import { KSwiper, KSwiperItem } from 'kbone-ui'

export default Vue.extend({
  name: 'Home',
  components: {
    KSwiper,
    KSwiperItem,
  },
  created() {

  },
  methods: {

  },
})
</script>

<style lang="less">
.content {
  display: flex;
  width: 100%;
  margin-top: 20px;
  justify-content: center;
  justify-items: center;

  .swiper-wrapper {
    width: 320px;
    height: 240px;
    .weui-swiper-item {
      width: 320px;
      height: 240px;
    }
    img {
      width: 320px;
      height: 240px;
    }
  }
}

</style>
JimmyVV commented 4 years ago

have you imported the kbone-ui.css ?

qinwf commented 4 years ago

Yes, it is imported in the root page.

Here is the online example. The swiper works on small screens like iPhone but not on wide screens.

https://wonderful-ramanujan-22efd5.netlify.com/

<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script>
import 'kbone-ui/lib/weui/weui.css'

import Vue from 'vue'

export default Vue.extend({
  name: 'App',
})
</script>