| | |
| | | @change="change" |
| | | > |
| | | |
| | | <el-option v-for="item in options" :key="item.path" :value="item" :label="item.item.title.join('>')" /> |
| | | <el-option |
| | | v-for="item in options" |
| | | v-show="item.item.title.length>1" |
| | | :key="item.path" |
| | | :value="item" |
| | | :label="item.item.title.join('>')" |
| | | /> |
| | | </el-select> |
| | | </div> |
| | | </template> |
| | |
| | | }, |
| | | mounted() { |
| | | this.searchPool = this.generateRoutes(this.routes) |
| | | |
| | | console.log(this.searchPool) |
| | | }, |
| | | methods: { |
| | | click() { |
| | |
| | | this.show = false |
| | | }, |
| | | change(val) { |
| | | console.log(val, 1) |
| | | this.$router.push(val.item.path) |
| | | this.search = '' |
| | | this.options = [] |
| | |
| | | // Filter out the routes that can be displayed in the sidebar |
| | | // And generate the internationalized title |
| | | generateRoutes(routes, basePath = '/', prefixTitle = []) { |
| | | // console.log(routes, 1) |
| | | let res = [] |
| | | |
| | | for (const router of routes) { |
| | | // skip hidden router |
| | | if (router.hidden) { continue } |
| | | if (router.hidden) { |
| | | continue |
| | | } |
| | | |
| | | const data = { |
| | | path: path.resolve(basePath, router.path), |
| | |
| | | } |
| | | } |
| | | } |
| | | // console.log(res, 2) |
| | | return res |
| | | }, |
| | | querySearch(query) { |
| | |
| | | vertical-align: middle; |
| | | } |
| | | |
| | | .svg-icon:hover{ |
| | | color: #42b983 !important; |
| | | .svg-icon:hover { |
| | | //color: #42b983 !important; |
| | | color: rgb(170, 170, 170) !important; |
| | | } |
| | | |
| | | .header-search-select { |