|
|
|
@ -17,8 +17,13 @@ |
|
|
|
> |
|
|
|
{{ item }} |
|
|
|
</li> |
|
|
|
<li class="letter del" :class="{ 'active-btn': current === 37 }" @click="del()"> |
|
|
|
<img src="@/assets/images/search/del.png" alt="" /> |
|
|
|
<li class="letter del" :class="{ 'active-btn': current === 37 }" @click="del(37)"> |
|
|
|
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"> |
|
|
|
<path |
|
|
|
d="M8.71275 4H27.9994C28.353 4 28.6922 4.14048 28.9422 4.39052C29.1923 4.64057 29.3328 4.97971 29.3328 5.33333V26.6667C29.3328 27.0203 29.1923 27.3594 28.9422 27.6095C28.6922 27.8595 28.353 28 27.9994 28H8.71275C8.4933 28 8.27723 27.9459 8.08371 27.8424C7.89019 27.7389 7.72522 27.5892 7.60342 27.4067L0.492754 16.74C0.346569 16.5209 0.268555 16.2634 0.268555 16C0.268555 15.7366 0.346569 15.4791 0.492754 15.26L7.60342 4.59333C7.72522 4.41078 7.89019 4.26111 8.08371 4.15761C8.27723 4.0541 8.4933 3.99997 8.71275 4ZM9.42609 6.66667L3.20475 16L9.42609 25.3333H26.6661V6.66667H9.42609ZM17.3328 14.1147L21.1034 10.3427L22.9901 12.2293L19.2181 16L22.9901 19.7707L21.1034 21.6573L17.3328 17.8853L13.5621 21.6573L11.6754 19.7707L15.4474 16L11.6754 12.2293L13.5621 10.3427L17.3328 14.1147Z" |
|
|
|
:fill="current === 37 ? '#ffffff' : '#9F9585'" |
|
|
|
/> |
|
|
|
</svg> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
@ -63,6 +68,7 @@ const letter = [ |
|
|
|
'M' |
|
|
|
] |
|
|
|
const current = ref(-1) |
|
|
|
const time = ref<any>() |
|
|
|
// 点击键盘其他按键 |
|
|
|
function handleLetter(item: string | number, index: number) { |
|
|
|
if (current.value === index) { |
|
|
|
@ -71,11 +77,20 @@ function handleLetter(item: string | number, index: number) { |
|
|
|
if (props.word.length < 10) { |
|
|
|
emit('change', item) |
|
|
|
current.value = index |
|
|
|
time.value = setTimeout(() => { |
|
|
|
clearTimeout(time.value) |
|
|
|
current.value = -1 |
|
|
|
}, 500) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 删除 |
|
|
|
function del() { |
|
|
|
function del(index: number) { |
|
|
|
current.value = index |
|
|
|
time.value = setTimeout(() => { |
|
|
|
clearTimeout(time.value) |
|
|
|
current.value = -1 |
|
|
|
}, 500) |
|
|
|
emit('del') |
|
|
|
} |
|
|
|
</script> |
|
|
|
@ -160,7 +175,11 @@ function del() { |
|
|
|
} |
|
|
|
} |
|
|
|
.active-btn { |
|
|
|
animation: gradient 3s ease 1; |
|
|
|
color: #fff; |
|
|
|
background: #9b8c85; |
|
|
|
img { |
|
|
|
filter: invert(1) brightness(100%); |
|
|
|
} |
|
|
|
} |
|
|
|
.del { |
|
|
|
width: 184px; |
|
|
|
@ -169,24 +188,4 @@ function del() { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@keyframes gradient { |
|
|
|
0% { |
|
|
|
background: #f4f4f4; |
|
|
|
} |
|
|
|
25% { |
|
|
|
color: #fff; |
|
|
|
background: #9b8c85; |
|
|
|
} |
|
|
|
50% { |
|
|
|
color: #fff; |
|
|
|
background: #9b8c85; |
|
|
|
} |
|
|
|
75% { |
|
|
|
background: #f4f4f4; |
|
|
|
} |
|
|
|
100% { |
|
|
|
background: #f4f4f4; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
|