Header.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <script setup lang="ts">
  2. import {CirclePlus, UserFilled, SwitchButton} from "@element-plus/icons-vue";
  3. import {ref} from 'vue';
  4. const searchContent = ref('')
  5. function search() {
  6. //todo: search
  7. }
  8. </script>
  9. <template>
  10. <div class="bg-primary-500 min-w-full top-0 shadow-md flex-shrink-0 rounded-b-xl">
  11. <div class="mx-4 p-4">
  12. <div class="flex items-center justify-between space-x-4">
  13. <div class="flex items-center">
  14. <router-link to="/home" v-slot="{navigate}">
  15. <h1 @click="navigate" class="text-xl text-white"> 蓝鲸在线购物 </h1>
  16. </router-link>
  17. </div>
  18. <div class="w-3/4">
  19. <form>
  20. <div class="relative">
  21. <!--网上抄的logo-->
  22. <div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
  23. <svg class="w-4 h-4 text-gray-500 dark:text-gray-400" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20">
  24. <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"/>
  25. </svg>
  26. </div>
  27. <input type="search" id="search"
  28. v-model="searchContent"
  29. class="block w-full p-4 ps-10 text-gray-900 border border-gray-300 rounded-3xl bg-gray-50 focus:ring-blue-500 focus:border-blue-500" placeholder="国货好物" required>
  30. <button type="submit" @click="search"
  31. class="text-white absolute end-5 bottom-2.5 bg-primary-600 hover:bg-primary-700 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-3xl text-sm px-4 py-2">搜索商品</button>
  32. </div>
  33. </form>
  34. </div>
  35. <div class="flex items-center space-x-4 mx-3">
  36. <router-link to="/manager/createStore" v-slot="{navigate}">
  37. <el-icon @click="navigate" :size="30" color="white" ><CirclePlus /></el-icon>
  38. </router-link>
  39. <router-link to="/dashboard" v-slot="{navigate}">
  40. <el-icon @click="navigate" :size="30" color="white" ><UserFilled /></el-icon>
  41. </router-link>
  42. <router-link to="/" v-slot="{navigate}">
  43. <el-icon @click="navigate" :size="30" color="white" ><SwitchButton /></el-icon>
  44. </router-link>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </template>
  50. <style scoped>
  51. </style>