如何点击查询按钮,跳转到搜索页面

img


<el-button type="primary" @click="search()">查询
// 跳转到搜索页面star
search() {
this.$router.push({
path: "/search/searchResult"
})
},
// 跳转到搜索页面end

img

img


这里要加/吧,是/searchResult
然后是this.$router.push({
path: "/searchResult"
})


this.$router.push("/searchResult")
this.$router.push({ name: 'search' })