header.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <div class="header grid min-h-sm w-full flex flex-col">
  3. <div class="w-full h-[100px] flex max-w-screen-xl my-0 mx-auto justify-between items-center">
  4. <div class="logo">
  5. <a href="/"> <img src="@/assets/img/logo_4dge_cn.png" alt="logo" /></a>
  6. </div>
  7. <div class="menu">
  8. <n-dropdown :options="options" @select="handleSelect">
  9. <n-button type="primary" ghost>{{ locale === 'zh' ? $t('zh') : $t('en') }}</n-button>
  10. </n-dropdown>
  11. </div>
  12. </div>
  13. <div class="search-box w-full flex justify-center items-center flex-col">
  14. <n-h1 class="font-size-[48px] font-500">{{ $t('helperTip') }}</n-h1>
  15. <n-input class="max-w-[640px]" size="large" round placeholder="输入关键字">
  16. <template #prefix>
  17. <n-icon :component="SearchOutline" />
  18. </template>
  19. </n-input>
  20. </div>
  21. </div>
  22. </template>
  23. <script setup lang="ts">
  24. import { NH1, NInput, NIcon, NDropdown, NButton } from 'naive-ui'
  25. import { SearchOutline } from '@vicons/ionicons5'
  26. const { t, locale } = useI18n()
  27. const options = ref([
  28. {
  29. label: t('zh'),
  30. key: 'zh',
  31. },
  32. {
  33. label: t('en'),
  34. key: 'en',
  35. },
  36. ])
  37. const handleSelect = (key: string) => {
  38. locale.value = key
  39. }
  40. </script>
  41. <style>
  42. .header {
  43. background-image: url('@/assets/img/banner_bg1.png');
  44. background-repeat: no-repeat;
  45. background-size: cover;
  46. background-position: top center;
  47. }
  48. </style>