navigator.uvue 1.8 KB

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