页面跳转:

<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>

 

相关文章:

  • 2022-02-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2021-12-26
  • 2021-12-04
  • 2021-12-15
猜你喜欢
  • 2021-06-15
  • 2022-12-23
  • 2021-10-13
  • 2022-02-12
  • 2021-07-31
  • 2021-11-29
  • 2021-05-15
相关资源
相似解决方案