222
YM
2024-05-17 0b4fa4b2cfd68528d15aa71557425a7a80e3fc41
src/components/headNav/headNav.vue
@@ -1,9 +1,14 @@
<template>
  <view class="headNav">
    <view class="NavTop flex" :style="{ backgroundImage: 'url(' + bg + ')' }" >
    <view class="NavTop flex" :style="{ backgroundImage: 'url(' + bg + ')' }">
      <view
        class="santiaogang"
        style="width: 0.34rem; height: 0.34rem; margin-right: 3rem;cursor: pointer;"
        style="
          width: 0.34rem;
          height: 0.34rem;
          margin-right: 3rem;
          cursor: pointer;
        "
        @click="menuNav = !menuNav"
        ><img
          style="width: 100%; height: 100%"
@@ -311,17 +316,18 @@
    },
    // 切换搜索框的展开和收起状态
    toggleSearch() {
      // console.log('撒旦范德萨发生的',this.searchInput);
      this.isExpanded = !this.isExpanded;
      this.$nextTick(() => {
        if (this.searchInput.trim() !== "") {
          console.log("搜索", this.searchInput);
          uni.navigateTo({
            url:
              "/pages/knowledgeBase/knowledgeBase?keyword=" + this.searchInput
          });
        } else {
          console.log("不搜索");
        }
        this.searchInput = "";
        console.log(this.isExpanded);
      });
    }
  }