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

How uniapp implements page address jump

coldplay.xixi
Release: 2023-01-13 00:44:09
Original
11219 people have browsed it

Uniapp's method to implement page address jump: 1. Use the navigator tag, the code is []; 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>
Copy after login

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>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template