|
@@ -0,0 +1,68 @@
|
|
|
+<template>
|
|
|
+ <div class="d-flex align-center" style="margin: 0 auto;" :class="{'px-3': isMobile}" :style="{'width': isMobile ? '100%' : '800px'}">
|
|
|
+ <div class="search d-flex align-center">
|
|
|
+ <v-text-field
|
|
|
+ v-model="value"
|
|
|
+ :placeholder="defineProps.placeholder"
|
|
|
+ color="primary"
|
|
|
+ variant="plain"
|
|
|
+ density="compact"
|
|
|
+ :hide-details="true"
|
|
|
+ clearable
|
|
|
+ class="ml-3 px-2"
|
|
|
+ style="height: 40px; line-height: 100%;"
|
|
|
+ prepend-icon="mdi-magnify"
|
|
|
+ @click:clear="handleSearch"
|
|
|
+ @keyup.enter="handleSearch"
|
|
|
+ ></v-text-field>
|
|
|
+ <v-hover v-slot="{ isHovering, props }">
|
|
|
+ <v-btn
|
|
|
+ v-bind="props"
|
|
|
+ v-ripple.center
|
|
|
+ class="searchBtn mr-1"
|
|
|
+ @click="handleSearch"
|
|
|
+ :class="isHovering ? 'elevation-10' : 'elevation-5'"
|
|
|
+ :style="{'width': isMobile ? '100px' : '180px'}"
|
|
|
+ >搜索</v-btn>
|
|
|
+ </v-hover>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+defineOptions({ name:'jobFairSearchBar'})
|
|
|
+import { ref } from 'vue'
|
|
|
+
|
|
|
+const emits = defineEmits(['handleSearch'])
|
|
|
+const defineProps = defineProps({
|
|
|
+ modelValue: [String, Number],
|
|
|
+ placeholder: {
|
|
|
+ type: String,
|
|
|
+ default: '搜索职位/公司关键字'
|
|
|
+ },
|
|
|
+ isMobile: Boolean
|
|
|
+})
|
|
|
+
|
|
|
+const value = ref(defineProps.modelValue)
|
|
|
+
|
|
|
+const handleSearch = () => {
|
|
|
+ emits('handleSearch', value.value)
|
|
|
+}
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.search {
|
|
|
+ height: 50px;
|
|
|
+ width: 800px;
|
|
|
+ line-height: 50px;
|
|
|
+ border-radius: 6px;
|
|
|
+ background: #fff;
|
|
|
+ .searchBtn {
|
|
|
+ height: 40px;
|
|
|
+ font-size: 18px;
|
|
|
+ color: #fff;
|
|
|
+ background-color: var(--v-primary-base);
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|