2018-08-28 09:58:31 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="panel-search">
|
|
|
|
|
<div class="panel-search__input-group" flex="main:center cross:center">
|
|
|
|
|
<el-input
|
|
|
|
|
class="panel-search__input"
|
|
|
|
|
ref="input"
|
|
|
|
|
v-model="input"
|
|
|
|
|
suffix-icon="el-icon-search"
|
2018-08-28 11:12:51 +08:00
|
|
|
placeholder="搜索页面"
|
|
|
|
|
@keydown.esc.native="handleEsc"/>
|
2018-08-28 09:58:31 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
input: ''
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
focus () {
|
|
|
|
|
this.$nextTick(() => {
|
2018-08-28 11:12:51 +08:00
|
|
|
this.input = ''
|
2018-08-28 09:58:31 +08:00
|
|
|
this.$refs.input.focus()
|
|
|
|
|
})
|
2018-08-28 11:12:51 +08:00
|
|
|
},
|
|
|
|
|
handleEsc () {
|
|
|
|
|
this.$emit('close')
|
2018-08-28 09:58:31 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.panel-search {
|
|
|
|
|
margin: 20px;
|
|
|
|
|
.panel-search__input-group {
|
|
|
|
|
height: 200px;
|
|
|
|
|
.panel-search__input {
|
|
|
|
|
width: 300px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|