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组件嵌套多层时,外层的切换显示偏移异常,必现 #2012

Closed
lvsuming opened this issue Sep 20, 2017 · 2 comments
Closed

Comments

@lvsuming
Copy link

lvsuming commented Sep 20, 2017

<template>  
  <div>
    <tab :line-width=2 v-model="demoIndex">
      <tab-item class="vux-center" :selected="demo===item" v-for="(item,index) in demoList" @click="demo=item" :key="index">{{item}}</tab-item>
    </tab>
    <swiper v-model="demoIndex" height="100px" :show-dots="false" style="width:375px;overflow:hidden;>
      <swiper-item v-for="(item,index) in demoList" :key="index">
        <div class="tab-swiper vux-center">
          {{item}}
          <div v-if="index===0"><!--重点:此处为字符串时正常,为子组件时异常-->
          <tab :line-width=2 v-model="demoIndex2">
            <tab-item class="vux-center" :selected="demo2===item" v-for="(item,index) in demoList2" @click="demo2=item" :key="index">{{item}}</tab-item>
            </tab>
            <swiper v-model="demoIndex2" height="100px" :show-dots="false" style="width:375px;overflow:hidden;">
              <swiper-item v-for="(item,index) in demoList2" :key="index">{{item}}</swiper-item>
            </swiper>
          </div>
          <div v-if="index===1">{{'2222'}}</div>
        </div>
      </swiper-item>
   </swiper>
 </div>
</template>
<script>
import Vue from 'vue';  
import { Tab, TabItem, Swiper, SwiperItem} from 'vux';  
export default {
	name : 'hello',
	components : {
		Tab,
		TabItem,
		Swiper,
		SwiperItem
	},
	data() {
		return {
			demoList : ['A1', 'A2'],
			demo : null,
			demoIndex : 0,
			demoList2 : ['B1', 'B2'],
			demo2 : null,
			demoIndex2 : 0,
		}
	}
};
</script>

实测下图标红部分为0时才正常显示。
qq 20170920115401
下图为重现效果图:第二张应显示‘2222’
qq 20170920160922
qq 20170920160930

@lvsuming lvsuming changed the title swiper组件嵌套多层时,外层的切换显示偏移异常 swiper组件嵌套多层时,外层的切换显示偏移异常,必现 Sep 20, 2017
@airyland
Copy link
Owner

不得不说,对比这个 issue,上一个 issue 的问题描述真是太不靠谱了。

@airyland
Copy link
Owner

目前可以确认的是 swiper 应用场景不支持也不计划支持嵌套,因此该 issue 将关闭,建议使用社区其他组件。

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

No branches or pull requests

2 participants