uni-app 页面跳转的两种方法


1.navigator 标签

1 <navigator url="../hello/hello" open-type="navigate">
2     <view class="struct">
3         I am {{student.age}} yeas old </br>
4  I have skills such as {{student.skill[0]}},{{student.skill[1]}} 5     </view>
6 </navigator>

 

 

2.@tap事件跳转

 

<view class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(item,index) in news" :key="index" @tap="openinfo">
    <view class="uni-media-list-text-top">{{item.title}}</view>
</view>
 
 
<script> methods: { openinfo(e) { console.log(e) var newsid = e.currentTarget.dataset.newsid ; uni.navigateTo({ url: '../info/info?newsid='+newsid, success: res => {}, fail: () => {}, complete: () => {} }); } } </script>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM