function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i=0;i
{{item.title}}
{{decodeURIComponent(item.description)}}
`, data() { return { query: this.$route.query, menu: [], active: 0, config: window.exports, lists: [], currentSelect: 0, } }, mounted() { this.code = getQueryVariable('code'); this.current = this.config[this.code]; this.current.args.enter && this.current.args.enter({code: this.code, type: '', payload: [] }, (lists) => { this.lists = lists; }); ipcRenderer.on(`changeCurrent`, (e, result) => { if (this.currentSelect + result > this.lists.length - 1 || this.currentSelect + result < 0) return; this.currentSelect = this.currentSelect + result; }); ipcRenderer.on(`msg-back-setSubInput`, (e, result) => { this.current.args.search && this.current.args.search({code: this.code, type: '', payload: [] }, result, (lists) => { this.lists = lists; }) }); }, methods: { select(item) { this.current.args.select && this.current.args.select({code: this.code, type: '', payload: [] }, item); }, renderTitle(title) { const result = title.split(this.searchValue); return `
${result[0]}${this.searchValue}${result[1]}
` }, } }