Vue:uni-app學習(二)--頁面跳轉


 頁面跳轉:

<template>
    <view class="content">

      <navigator url="../form/form" open-type="navigate">
        <button type="primary" class="button1">表單設置1-支持返回</button>
      </navigator>

        <button type="primary" class="button1" @click="jumpToPage('/pages/sub/form/form','')">表單設置2-支持返回</button>
        <button type="primary" class="button1" @click="jumpToPage('/pages/my/my','tab')">跳轉至my-tab</button>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                title: 'Hello'
            }
        },
        onLoad() {

        },
        methods: {
            jumpToPage(url,type){ if(type == 'tab'){
                    uni.switchTab({
                        url: url
                    })
                }else{ uni.navigateTo({ url: url }) } }
        }
    }
</script>

<style>
    .button1{
        margin-top: 20px;
    }
</style>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM