]; 2. Use the [@tap] event to jump ."/> ]; 2. Use the [@tap] event to jump .">

Home  >  Article  >  Web Front-end  >  How uniapp implements page address jump

How uniapp implements page address jump

coldplay.xixi
coldplay.xixiOriginal
2020-12-08 16:07:3911164browse

Uniapp's method to implement page address jump: 1. Use the navigator tag, the code is [d5231c3ec813bfcaeaa0bf47768ea406]; 2. Use [@tap] event to jump.

How uniapp implements page address jump

The operating environment of this tutorial: windows7 system, uni-app2.5.1 version, thinkpad t480 computer.

Recommended (free): uni-app development tutorial

uniapp implements page address jump Method:

1.navigator tag

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

2.@tap event jump

<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: &#39;../info/info?newsid=&#39;+newsid,
                    success: res => {},
                    fail: () => {},
                    complete: () => {}
                });
            }
        }
</script>

Related free learning recommendations: Programming Video

The above is the detailed content of How uniapp implements page address jump. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn