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