优化
This commit is contained in:
@@ -28,7 +28,8 @@
|
||||
<div class="title">历史搜索</div>
|
||||
<div class="info-box">
|
||||
<div :class="flexacenter" v-for="(item, i) in historyArr" :key="i"
|
||||
class="btn" @click="handleKeyword(item)">{{ item }}
|
||||
class="btn flexacenter" @click="handleKeyword(item)">
|
||||
<div class="flexflex">{{ item }}</div>
|
||||
<img class="btn-icon" src="../../assets/homeImage/closeIcon.svg"
|
||||
@click.stop="deleteSeachVal(i)" alt="">
|
||||
<img>
|
||||
@@ -66,7 +67,7 @@
|
||||
<template #reference>
|
||||
<div class="tool-btn consult-btn flexcenter">
|
||||
<img class="consult-icon" src="@/assets/img/publicImage/consult-icon.png">
|
||||
咨询小助手
|
||||
咨询方同学
|
||||
</div>
|
||||
</template>
|
||||
<div class="consult-pop flexacenter">
|
||||
@@ -318,6 +319,12 @@ const selectOption = (type, value) => {
|
||||
emit('handleTransfer', pitchValue)
|
||||
})
|
||||
}
|
||||
|
||||
//删除历史记录
|
||||
let deleteSeachVal = (i) => {
|
||||
historyArr.value.splice(i, 1)
|
||||
localStorage.setItem('historyArr', JSON.stringify(historyArr.value));
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
* {
|
||||
@@ -737,9 +744,20 @@ const selectOption = (type, value) => {
|
||||
margin: 20px 30px 0 0;
|
||||
cursor: pointer;
|
||||
word-break: break-word;
|
||||
position: relative;
|
||||
&:hover .btn-icon {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.btn-icon {
|
||||
margin-left: 5px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: -16px;
|
||||
transform: translateY(-50%);
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
margin-left: 6px;
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user