CusNavigation.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <div style="height: 36px; padding: 0px 0px 0px 0px; display: flex; align-items: center;">
  3. <!-- <div style="padding: 16px 0px 0px 24px;">
  4. <a-breadcrumb>
  5. <a-breadcrumb-item style="font-family: PingFangSC, PingFang SC;">首页</a-breadcrumb-item>
  6. <a-breadcrumb-item><a href="">Application Center</a></a-breadcrumb-item>
  7. <a-breadcrumb-item><a href="">Application List</a></a-breadcrumb-item>
  8. <a-breadcrumb-item>An Application</a-breadcrumb-item>
  9. </a-breadcrumb>
  10. </div> -->
  11. <div style="line-height: 0px;" v-if="gobackabled" class="cus-goback" @click="onGoback">
  12. <van-icon name="static/images/icon-back.png" size="1.7rem" />
  13. </div>
  14. <div style="font-family: PingFangSC, PingFang SC;
  15. font-weight: bold;
  16. font-size: 1.1rem;
  17. color: #191A1A;
  18. line-height: 30px;
  19. text-align: justify;
  20. font-style: normal;">
  21. <span>{{ title }}</span>
  22. </div>
  23. <template v-if="searchabled">
  24. <div style="background-color: #eee; border-radius: 2.5rem; width: 0px; flex-grow: 1; margin: 0px 5px 0px 5px;">
  25. <van-field style="padding: 6px 16px;" v-model="keyWord" size="normal" clearable />
  26. </div>
  27. <div style="line-height: 0px;" @click="onSearch">
  28. <van-icon name="static/images/icon-search-black.png" size="2rem" />
  29. </div>
  30. </template>
  31. </div>
  32. </template>
  33. <script setup lang="ts">
  34. import { ref } from 'vue'
  35. import { Router, useRouter } from 'vue-router'
  36. // 属性
  37. defineProps({
  38. title: {
  39. type: String,
  40. default: undefined
  41. },
  42. gobackabled: {
  43. type: Boolean,
  44. default: false
  45. },
  46. searchabled: {
  47. type: Boolean,
  48. default: false
  49. }
  50. })
  51. // 事件
  52. const emits = defineEmits(['onSearch'])
  53. // 搜索
  54. const keyWord = ref('');
  55. const onSearch = () => {
  56. emits('onSearch', keyWord.value)
  57. }
  58. // 返回上一页
  59. const router:Router = useRouter();
  60. const onGoback = (event: any) => {
  61. console.log(event);
  62. router.go(-1)
  63. }
  64. </script>
  65. <style scoped>
  66. .cus-goback{
  67. margin-right: 3px;
  68. }
  69. .cus-goback:hover{
  70. cursor: pointer;
  71. }
  72. </style>