Skip to content

Commit e0adbf6

Browse files
committed
fix: manualClose not work and close event not exist (close #17,#18)
add: add immediateClose option to close dialog when click emoji (close #18)
1 parent c2b218e commit e0adbf6

File tree

5 files changed

+344
-295
lines changed

5 files changed

+344
-295
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ const customTheme = {
336336

337337
| 配置名 | 配置类型 | 默认值 | 说明/备注 |
338338
| :------------: | :-------------------: | :-----------------: | :--------------------------------------------------------------------------------------------------: |
339-
| size | mid\|'small'\|'big' | mid | 用于调整整体大小 |
339+
| size | 'mid'\|'small'\|'big' | mid | 用于调整整体大小 |
340340
| theme | 'dark'\|'default' | default | 主题切换 支持亮色和暗黑主题 |
341341
| manualClose | boolean | false | 设置为 true 可以手动控制弹出框的关闭 |
342342
| optionsName | - | {} | 翻译原有板块名字 |
@@ -352,6 +352,7 @@ const customTheme = {
352352
| unicodeVersion | number | 11 | 在某些设备上可能不能兼容高版本的 emojiunicode |
353353
| _skin_ | - | none | 暂时无法很好的支持 |
354354
| tippyOptions | 自定义 tippy 的配置 | | https://atomiks.github.io/tippyjs/v6/customization/ |
355+
| immediateClose | boolean | false | 设置为 true 时点击表情后立即关闭 |
355356

356357
```ts
357358
type FixType = 'upleft' | 'upright' | 'upcenter' | 'downleft' | 'downright' | 'downcenter' //控制表情弹出框的位置

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"private": false,
44
"author": "ADKCodeXD",
55
"description": "一个简单的Emoji表情选择组件",
6-
"version": "3.0.4",
6+
"version": "3.0.5",
77
"license": "MIT",
88
"main": "./dist/Vue3Emoji.umd.js",
99
"module": "./dist/Vue3Emoji.es.js",

src/App.vue

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const optionsName = {
1919
}
2020
const disableGroup = ['食物&饮料']
2121
const abc = ref('这里是双向绑定的值')
22+
const manualClose = ref()
2223
const clickEvent = ref('')
2324
const customIcon: Emoji.JsonData = {
2425
'Smileys & Emotion': '😚',
@@ -64,6 +65,10 @@ const disableGroup2 = [
6465
'Flags',
6566
'Activities',
6667
]
68+
69+
const closeCustom = () => {
70+
manualClose.value?.closePop()
71+
}
6772
</script>
6873

6974
<template>
@@ -96,6 +101,25 @@ const disableGroup2 = [
96101
<V3Emoji size="mid" :custom-tab="customTab" :disable-group="disableGroup2" />
97102
<p>customTab</p>
98103
</div>
104+
<div class="test">
105+
<V3Emoji size="mid" :keep="true" />
106+
<p>keep</p>
107+
</div>
108+
<div class="test">
109+
<V3Emoji
110+
size="mid"
111+
:immediate-close="true"
112+
:manual-close="true"
113+
ref="manualClose"
114+
@close="
115+
() => {
116+
console.log('close')
117+
}
118+
"
119+
/>
120+
<p>manual-close</p>
121+
</div>
122+
<button @click="closeCustom">close</button>
99123
</div>
100124
<div id="app">
101125
<div>

0 commit comments

Comments
 (0)