navigator.uvue 1.8 KB
Newer Older
1
<template>
2 3
  <page-head :title="title"></page-head>
  <view class="uni-padding-wrap uni-common-mt">
4
    <navigator id="navigate" class="navigator" url="navigate?title=navigate">
5 6
      <button type="default">跳转到新页面</button>
    </navigator>
7
    <navigator id="redirect" class="navigator" url="redirect?title=redirect" open-type="redirect">
W
wanganxp 已提交
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
      <button type="default">在当前页打开redirect</button>
    </navigator>
    <navigator id="switchTab" class="navigator" url="/pages/tabBar/template" open-type="switchTab">
      <button type="default">切换到模板选项卡switchTab</button>
    </navigator>
    <navigator id="reLaunch" class="navigator" url="/pages/tabBar/component" open-type="reLaunch">
      <button type="default">关闭所有页面回首页reLaunch</button>
    </navigator>
    <navigator id="reLaunch" class="navigator" open-type="navigateBack">
      <button type="default">返回上一页navigateBack</button>
    </navigator>
    <!-- <navigator id="reLaunch" class="navigator" open-type="exit">
      <button type="default">退出应用(仅Android和小程序生效)</button>
    </navigator> -->
    <navigator id="navigateToErrorPage" class="navigator" url="/pages/error-page/error-page" >
      <button type="default"> 打开不存在的页面 </button>
    </navigator>
    <navigator id="navigateToErrorPage" class="navigator">
      <button type="default"> 未指定URL的跳转 </button>
27
    </navigator>
雪洛's avatar
雪洛 已提交
28 29 30 31
    <navigator style="flex-direction: row;justify-content: space-between;">
      <text>两端对齐样式测试</text>
      <view style="width: 20px;height: 20px; background-color: aqua;"></view>
    </navigator>
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
  </view>
</template>

<script>
  export default {
    data() {
      return {
        title: 'navigator'
      }
    }
  }
</script>

<style>
  .navigator {
47
    margin-bottom: 15px;
48
  }
49
</style>