Skip to content

Commit

Permalink
Merge pull request #98 from tarzandong/search
Browse files Browse the repository at this point in the history
search跳转
  • Loading branch information
kevin-geng authored Nov 1, 2023
2 parents 686399f + 24b6aba commit e5f8d59
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/components/common/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
:suffix-icon="Search"
:remote-method="remoteMethod"
:loading="loading"
@change="searchChange"
@visible-change ="searchChange"
>
<el-option
v-for="item in options"
Expand Down Expand Up @@ -169,6 +169,7 @@ import { searchCourse } from '@/utils/api/course.js';
import { getInfo } from '@/utils/api/api.js';
// import { useRoute } from 'vue-router'
import { Upload } from '@element-plus/icons-vue';
import { nextTick } from 'vue';
const { router, route, userStore } = inject('baseTool');
//用户信息
let userInfo = computed(() => {
Expand Down Expand Up @@ -231,12 +232,15 @@ const remoteMethod = (query) => {
};
const searchChange = (val) => {
router.push({
path: '/course/detail',
query: {
id: val,
},
});
if (!val)
nextTick(()=>{
router.push({
path: '/course/detail',
query: {
id: searchInput.value,
},
})
})
};
const handleScroll = () => {
Expand Down

0 comments on commit e5f8d59

Please sign in to comment.