From 5bc507a8a7be9cbbad0fa2472f72b1d336f31ef2 Mon Sep 17 00:00:00 2001 From: 杨磊 <505174330@qq.com> Date: 星期五, 25 四月 2025 16:58:52 +0800 Subject: [PATCH] ces --- src/views/home/components/searchBox.vue | 39 ++++++++++++++++++++++++++------------- 1 files changed, 26 insertions(+), 13 deletions(-) diff --git a/src/views/home/components/searchBox.vue b/src/views/home/components/searchBox.vue index b549c26..b003316 100644 --- a/src/views/home/components/searchBox.vue +++ b/src/views/home/components/searchBox.vue @@ -15,7 +15,7 @@ </el-select> <div class="inputBox"> <input type="text" v-model="searchText" class="search-input" /> - <div class="searchBtn">鎼滅储</div> + <div class="searchBtn" @click="handleSearch()">鎼滅储</div> </div> </div> </template> @@ -23,23 +23,35 @@ <script> export default { name: "SearchBox", + props: { + // 鎺ユ敹澶栭儴浼犲叆鐨勯�夐」 + options: { + type: Array, + default: () => [ + { value: "all", label: "鍏ㄩ儴" }, + { value: "name", label: "鏍囬" }, + { value: "author", label: "浣滆��" }, + { value: "year", label: "骞翠唤" }, + { value: "keyWords", label: "鍏抽敭璇�" }, + { value: "abstract", label: "鎽樿" }, + { value: "source", label: "鏉ユ簮" }, + ], + searchFun: { + type: Function, + default: () => {}, + }, + }, + }, data() { return { searchText: "", // 杈撳叆妗嗗唴瀹� selectedType: "", // 涓嬫媺妗嗛�変腑鍊� - options: [ - // 涓嬫媺閫夐」 - { value: "all", label: "鍏ㄩ儴" }, - { value: "name", label: "鍚嶇О" }, - { value: "id", label: "ID" }, - { value: "code", label: "缂栫爜" }, - ], }; }, methods: { // 鎼滅储澶勭悊 handleSearch() { - this.$emit("search", { + this.$emit("searchFun", { text: this.searchText, type: this.selectedType, }); @@ -54,14 +66,16 @@ max-width: 800px; display: flex; align-items: center; + background-color: #fff; } /* 杈撳叆妗嗘牱寮� */ .search-input { + background-color: transparent; } .inputBox { - border: 1px solid #B9A587; + border: 1px solid #b9a587; height: 38px; width: 400px; display: flex; @@ -95,10 +109,9 @@ .el-select /deep/ .el-input__inner { border-top-right-radius: 0; border-bottom-right-radius: 0; - border: 1px solid #B9A587; - + border: 1px solid #b9a587; + background-color: transparent; border-right: none; - } .el-input-group__prepend { -- Gitblit v1.9.1