added ESlint 语法检测
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
<template>
|
||||
<div class="search-component">
|
||||
<transition name="el-fade-in-linear">
|
||||
<div class="transition-box" style="display: inline-block; " v-show="show">
|
||||
<div v-show="show" class="transition-box" style="display: inline-block; ">
|
||||
<el-select
|
||||
ref="search-input"
|
||||
@blur="hiddenSearch"
|
||||
@change="changeRouter"
|
||||
v-model="value"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
v-model="value"
|
||||
@blur="hiddenSearch"
|
||||
@change="changeRouter"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in routerList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
v-for="item in routerList"
|
||||
></el-option>
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
</transition>
|
||||
@@ -23,43 +23,42 @@
|
||||
:style="{display:'inline-block',float:'right',width:'31px',textAlign:'left',fontSize:'16px',paddingTop:'2px'}"
|
||||
class="user-box"
|
||||
>
|
||||
<i @click="$bus.$emit('reload')" :style="{cursor:'pointer'}" class="el-icon-refresh" />
|
||||
<i :style="{cursor:'pointer'}" class="el-icon-refresh" @click="$bus.$emit('reload')" />
|
||||
</div>
|
||||
<div :style="{display:'inline-block',float:'right'}" class="user-box">
|
||||
<i :style="{cursor:'pointer'}" @click="showSearch()" class="el-icon-search search-icon"></i>
|
||||
<i :style="{cursor:'pointer'}" class="el-icon-search search-icon" @click="showSearch()" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from "vuex";
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: "searchComponent",
|
||||
name: 'SearchComponent',
|
||||
data() {
|
||||
return {
|
||||
value: "",
|
||||
value: '',
|
||||
show: false
|
||||
};
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters("router", ["routerList"])
|
||||
...mapGetters('router', ['routerList'])
|
||||
},
|
||||
methods: {
|
||||
changeRouter() {
|
||||
this.$router.push({ name: this.value });
|
||||
this.value = "";
|
||||
this.$router.push({ name: this.value })
|
||||
this.value = ''
|
||||
},
|
||||
hiddenSearch() {
|
||||
this.show = false;
|
||||
this.show = false
|
||||
},
|
||||
showSearch() {
|
||||
this.show = true;
|
||||
this.show = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs["search-input"].focus();
|
||||
});
|
||||
this.$refs['search-input'].focus()
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
</style>
|
||||
Reference in New Issue
Block a user