zhongshujie
3 天以前 34c4d498b69f746b98ff71afa14a9804e43afcf8
src/views/home/components/searchBox.vue
@@ -41,15 +41,20 @@
  data() {
    return {
      searchText: "", // 输入框内容
      selectedType: "", // 下拉框选中值
      selectedType: "all", // 下拉框选中值
    };
  },
  methods: {
    // 搜索处理
    handleSearch() {
    // 找到选中的选项的label
    const selectedOption = this.options.find(option => option.value === this.selectedType);
    const selectedLabel = selectedOption ? selectedOption.label : '';
    console.log(selectedLabel,"001")
      this.$emit("search", {
        text: this.searchText,
        type: this.selectedType,
        label: selectedLabel
      });
    },
  },
@@ -62,10 +67,13 @@
  max-width: 800px;
  display: flex;
  align-items: center;
  background-color: #fff;
}
/* 输入框样式 */
.search-input {
  width: 100%;
}
.inputBox {
@@ -74,6 +82,7 @@
  width: 400px;
  display: flex;
  justify-content: space-between;
  background-color: transparent !important;
  align-items: center;
  padding-right: 5px;
  border-radius: 5px;
@@ -86,6 +95,7 @@
  width: 70px;
  height: 30px;
  background-color: #937950;
  border-radius: 5px;
  margin-left: 10px;
  cursor: pointer;
  font-size: 14px;
@@ -104,7 +114,7 @@
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border: 1px solid #B9A587;
  background-color: transparent;
  border-right: none;
}