我把路由改成跳转nvue 页面就正常了 nuve-vue 不正常 nuve-nuve 正常
- 发布:2020-06-04 10:34
- 更新:2021-01-18 17:15
- 阅读:1199
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: w8
HBuilderX类型: 正式
HBuilderX版本号: 2.7.9
手机系统: Android
手机系统版本号: Android 10
手机厂商: 华为
手机机型: 一加
页面类型: nvue
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
<view class="fixed">
<t-navbar :customBar="CustomBar" :statusBar="StatusBar" :bg-color="currentBg" :src="src"></t-navbar>
</view>
<list :id="pageId" class="page" :style="{'top':CustomBar + 'px'}" :show-scrollbar="false" :bounce="false">
<cell>
<view id="head" class="header">
<view ref="top" :style="">
<cu-bg :bg-color="currentBg"></cu-bg>
<ad-banner :banner="adList" @change="changeBg" :style="{'margin-top': -CustomBar + 'px'}"></ad-banner>
<channel :list="channelList" :menu="headIndustryList"></channel>
</view>
</view>
</cell>
<cell>
<view class="tabs" id="body" :style="{height:pageHeight+'px'}">
<view class="app-tabs">
<scroll-view scroll-x class="tab-view " id="tab-bar" :scroll="false" :show-scrollbar="false" :scroll-into-view="scrollInto">
<view class="tab-bar-item" v-for="(item,index) in navBarList" :id="item.id" :ref="'tabitem'+index" :key="item.id" @tap="tabSelect" :data-current="index">
<text class="tab-title" :class="index==tabIndex?'cur-active-title':''">{{item.name}}</text>
<text class="tab-sub-title" :class="index==tabIndex?'cur-active-sub-title':''">{{item.remark}}</text>
</view>
</scroll-view>
</view>
<swiper :current="tabIndex" id="tab-bar-view" class="swiper-box" @change="ontabchange">
<swiper-item class="swiper-item" v-for="(tab,index) in navBarList" :key="index">
<scroll-list class="swiper-page" ref="page" :pid="tab.id" :parentId="pageId" :hasSlot="index==0" :i="index"
:index="tabIndex" :tabs="navBarList">
<block v-if="index ===0">
<sale :sale-row="saleRow" :sale-column="saleColumn"></sale>
</block>
</scroll-list>
</swiper-item>
</swiper>
</view>
</cell>
</list>
<view class="fixed">
<t-navbar :customBar="CustomBar" :statusBar="StatusBar" :bg-color="currentBg" :src="src"></t-navbar>
</view>
<list :id="pageId" class="page" :style="{'top':CustomBar + 'px'}" :show-scrollbar="false" :bounce="false">
<cell>
<view id="head" class="header">
<view ref="top" :style="">
<cu-bg :bg-color="currentBg"></cu-bg>
<ad-banner :banner="adList" @change="changeBg" :style="{'margin-top': -CustomBar + 'px'}"></ad-banner>
<channel :list="channelList" :menu="headIndustryList"></channel>
</view>
</view>
</cell>
<cell>
<view class="tabs" id="body" :style="{height:pageHeight+'px'}">
<view class="app-tabs">
<scroll-view scroll-x class="tab-view " id="tab-bar" :scroll="false" :show-scrollbar="false" :scroll-into-view="scrollInto">
<view class="tab-bar-item" v-for="(item,index) in navBarList" :id="item.id" :ref="'tabitem'+index" :key="item.id" @tap="tabSelect" :data-current="index">
<text class="tab-title" :class="index==tabIndex?'cur-active-title':''">{{item.name}}</text>
<text class="tab-sub-title" :class="index==tabIndex?'cur-active-sub-title':''">{{item.remark}}</text>
</view>
</scroll-view>
</view>
<swiper :current="tabIndex" id="tab-bar-view" class="swiper-box" @change="ontabchange">
<swiper-item class="swiper-item" v-for="(tab,index) in navBarList" :key="index">
<scroll-list class="swiper-page" ref="page" :pid="tab.id" :parentId="pageId" :hasSlot="index==0" :i="index"
:index="tabIndex" :tabs="navBarList">
<block v-if="index ===0">
<sale :sale-row="saleRow" :sale-column="saleColumn"></sale>
</block>
</scroll-list>
</swiper-item>
</swiper>
</view>
</cell>
</list> 预期结果:
<view class="fixed">
<t-navbar :customBar="CustomBar" :statusBar="StatusBar" :bg-color="currentBg" :src="src"></t-navbar>
</view>
<list :id="pageId" class="page" :style="{'top':CustomBar + 'px'}" :show-scrollbar="false" :bounce="false">
<cell>
<view id="head" class="header">
<view ref="top" :style="">
<cu-bg :bg-color="currentBg"></cu-bg>
<ad-banner :banner="adList" @change="changeBg" :style="{'margin-top': -CustomBar + 'px'}"></ad-banner>
<channel :list="channelList" :menu="headIndustryList"></channel>
</view>
</view>
</cell>
<cell>
<view class="tabs" id="body" :style="{height:pageHeight+'px'}">
<view class="app-tabs">
<scroll-view scroll-x class="tab-view " id="tab-bar" :scroll="false" :show-scrollbar="false" :scroll-into-view="scrollInto">
<view class="tab-bar-item" v-for="(item,index) in navBarList" :id="item.id" :ref="'tabitem'+index" :key="item.id" @tap="tabSelect" :data-current="index">
<text class="tab-title" :class="index==tabIndex?'cur-active-title':''">{{item.name}}</text>
<text class="tab-sub-title" :class="index==tabIndex?'cur-active-sub-title':''">{{item.remark}}</text>
</view>
</scroll-view>
</view>
<swiper :current="tabIndex" id="tab-bar-view" class="swiper-box" @change="ontabchange">
<swiper-item class="swiper-item" v-for="(tab,index) in navBarList" :key="index">
<scroll-list class="swiper-page" ref="page" :pid="tab.id" :parentId="pageId" :hasSlot="index==0" :i="index"
:index="tabIndex" :tabs="navBarList">
<block v-if="index ===0">
<sale :sale-row="saleRow" :sale-column="saleColumn"></sale>
</block>
</scroll-list>
</swiper-item>
</swiper>
</view>
</cell>
</list>
<view class="fixed">
<t-navbar :customBar="CustomBar" :statusBar="StatusBar" :bg-color="currentBg" :src="src"></t-navbar>
</view>
<list :id="pageId" class="page" :style="{'top':CustomBar + 'px'}" :show-scrollbar="false" :bounce="false">
<cell>
<view id="head" class="header">
<view ref="top" :style="">
<cu-bg :bg-color="currentBg"></cu-bg>
<ad-banner :banner="adList" @change="changeBg" :style="{'margin-top': -CustomBar + 'px'}"></ad-banner>
<channel :list="channelList" :menu="headIndustryList"></channel>
</view>
</view>
</cell>
<cell>
<view class="tabs" id="body" :style="{height:pageHeight+'px'}">
<view class="app-tabs">
<scroll-view scroll-x class="tab-view " id="tab-bar" :scroll="false" :show-scrollbar="false" :scroll-into-view="scrollInto">
<view class="tab-bar-item" v-for="(item,index) in navBarList" :id="item.id" :ref="'tabitem'+index" :key="item.id" @tap="tabSelect" :data-current="index">
<text class="tab-title" :class="index==tabIndex?'cur-active-title':''">{{item.name}}</text>
<text class="tab-sub-title" :class="index==tabIndex?'cur-active-sub-title':''">{{item.remark}}</text>
</view>
</scroll-view>
</view>
<swiper :current="tabIndex" id="tab-bar-view" class="swiper-box" @change="ontabchange">
<swiper-item class="swiper-item" v-for="(tab,index) in navBarList" :key="index">
<scroll-list class="swiper-page" ref="page" :pid="tab.id" :parentId="pageId" :hasSlot="index==0" :i="index"
:index="tabIndex" :tabs="navBarList">
<block v-if="index ===0">
<sale :sale-row="saleRow" :sale-column="saleColumn"></sale>
</block>
</scroll-list>
</swiper-item>
</swiper>
</view>
</cell>
</list> 实际结果:
<view class="fixed">
<t-navbar :customBar="CustomBar" :statusBar="StatusBar" :bg-color="currentBg" :src="src"></t-navbar>
</view>
<list :id="pageId" class="page" :style="{'top':CustomBar + 'px'}" :show-scrollbar="false" :bounce="false">
<cell>
<view id="head" class="header">
<view ref="top" :style="">
<cu-bg :bg-color="currentBg"></cu-bg>
<ad-banner :banner="adList" @change="changeBg" :style="{'margin-top': -CustomBar + 'px'}"></ad-banner>
<channel :list="channelList" :menu="headIndustryList"></channel>
</view>
</view>
</cell>
<cell>
<view class="tabs" id="body" :style="{height:pageHeight+'px'}">
<view class="app-tabs">
<scroll-view scroll-x class="tab-view " id="tab-bar" :scroll="false" :show-scrollbar="false" :scroll-into-view="scrollInto">
<view class="tab-bar-item" v-for="(item,index) in navBarList" :id="item.id" :ref="'tabitem'+index" :key="item.id" @tap="tabSelect" :data-current="index">
<text class="tab-title" :class="index==tabIndex?'cur-active-title':''">{{item.name}}</text>
<text class="tab-sub-title" :class="index==tabIndex?'cur-active-sub-title':''">{{item.remark}}</text>
</view>
</scroll-view>
</view>
<swiper :current="tabIndex" id="tab-bar-view" class="swiper-box" @change="ontabchange">
<swiper-item class="swiper-item" v-for="(tab,index) in navBarList" :key="index">
<scroll-list class="swiper-page" ref="page" :pid="tab.id" :parentId="pageId" :hasSlot="index==0" :i="index"
:index="tabIndex" :tabs="navBarList">
<block v-if="index ===0">
<sale :sale-row="saleRow" :sale-column="saleColumn"></sale>
</block>
</scroll-list>
</swiper-item>
</swiper>
</view>
</cell>
</list>
<view class="fixed">
<t-navbar :customBar="CustomBar" :statusBar="StatusBar" :bg-color="currentBg" :src="src"></t-navbar>
</view>
<list :id="pageId" class="page" :style="{'top':CustomBar + 'px'}" :show-scrollbar="false" :bounce="false">
<cell>
<view id="head" class="header">
<view ref="top" :style="">
<cu-bg :bg-color="currentBg"></cu-bg>
<ad-banner :banner="adList" @change="changeBg" :style="{'margin-top': -CustomBar + 'px'}"></ad-banner>
<channel :list="channelList" :menu="headIndustryList"></channel>
</view>
</view>
</cell>
<cell>
<view class="tabs" id="body" :style="{height:pageHeight+'px'}">
<view class="app-tabs">
<scroll-view scroll-x class="tab-view " id="tab-bar" :scroll="false" :show-scrollbar="false" :scroll-into-view="scrollInto">
<view class="tab-bar-item" v-for="(item,index) in navBarList" :id="item.id" :ref="'tabitem'+index" :key="item.id" @tap="tabSelect" :data-current="index">
<text class="tab-title" :class="index==tabIndex?'cur-active-title':''">{{item.name}}</text>
<text class="tab-sub-title" :class="index==tabIndex?'cur-active-sub-title':''">{{item.remark}}</text>
</view>
</scroll-view>
</view>
<swiper :current="tabIndex" id="tab-bar-view" class="swiper-box" @change="ontabchange">
<swiper-item class="swiper-item" v-for="(tab,index) in navBarList" :key="index">
<scroll-list class="swiper-page" ref="page" :pid="tab.id" :parentId="pageId" :hasSlot="index==0" :i="index"
:index="tabIndex" :tabs="navBarList">
<block v-if="index ===0">
<sale :sale-row="saleRow" :sale-column="saleColumn"></sale>
</block>
</scroll-list>
</swiper-item>
</swiper>
</view>
</cell>
</list> 3***@qq.com - 哈哈哈
2.8.3.20200728 版本仍然未修复
-
-
回复 DCloud_Android_DQQ:
跑是swiper-list,在cell上加一个点击事件,navigateTo 一个vue页面,从vue页面返回的时候 就会自动吸顶了
onClick(){
console.log("onClickonClickonClick")
uni.navigateTo({
url:"/pages/index/test/test"
})
},2020-08-14 20:23

6***@qq.com (作者)
是bug 吗 我怎么改都没反应
2020-06-04 17:43
6***@qq.com (作者)
大概啥时候能修复呀
2020-06-08 09:27