about.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <route lang="jsonc" type="page">
  2. {
  3. "layout": "tabbar",
  4. "style": {
  5. "navigationBarTitleText": "关于"
  6. }
  7. }
  8. </route>
  9. <script lang="ts" setup>
  10. import RequestComp from './components/request.vue'
  11. // 奇怪:同样的代码放在 vue 里面不会校验到错误,放在 .ts 文件里面会校验到错误
  12. // const testOxlint = (name: string) => {
  13. // console.log('oxlint')
  14. // }
  15. // testOxlint('oxlint')
  16. console.log('about')
  17. function gotoAlova() {
  18. uni.navigateTo({
  19. url: '/pages/about/alova',
  20. })
  21. }
  22. function gotoVueQuery() {
  23. uni.navigateTo({
  24. url: '/pages/about/vue-query',
  25. })
  26. }
  27. function gotoSubPage() {
  28. uni.navigateTo({
  29. url: '/pages-sub/demo/index',
  30. })
  31. }
  32. </script>
  33. <template>
  34. <view>
  35. <view class="mt-8 text-center text-xl text-gray-400">
  36. 组件使用、请求调用、unocss
  37. </view>
  38. <RequestComp />
  39. <view class="mb-6 h-1px bg-#eee" />
  40. <view class="text-center">
  41. <button type="primary" size="mini" class="w-160px" @click="gotoAlova">
  42. 前往 alova 示例页面
  43. </button>
  44. </view>
  45. <view class="text-center">
  46. <button type="primary" size="mini" class="w-160px" @click="gotoVueQuery">
  47. vue-query 示例页面
  48. </button>
  49. </view>
  50. <view class="text-center">
  51. <button type="primary" size="mini" class="w-160px" @click="gotoSubPage">
  52. 前往分包页面
  53. </button>
  54. </view>
  55. <view class="mt-6 text-center text-sm">
  56. <view class="inline-block w-80% text-gray-400">
  57. 为了方便脚手架动态生成不同UI模板,本页的按钮统一使用UI库无关的原生button
  58. </view>
  59. </view>
  60. </view>
  61. </template>
  62. <style lang="scss" scoped>
  63. .test-css {
  64. // 16rpx=>0.5rem
  65. padding-bottom: 16rpx;
  66. // mt-4=>1rem=>16px;
  67. margin-top: 16px;
  68. text-align: center;
  69. }
  70. </style>