-
-
-
-
closable
设置展示关闭按钮, close
监听关闭按钮点击事件,做删除操作。',
+ 'zh-CN':
+ '通过 closable
设置展示关闭按钮, before-delete
设置删除前的操作,可以在此钩子中做提示或确认;close
监听关闭按钮点击事件,做删除操作。',
'en-US':
- 'Set the display close button through close
, listen to the close button click event, and perform the deletion operation.'
+ 'Set the display close button throughclose
, andbefore-delete
to set the operation before deletion, which can be prompted or confirmed in this hook< Code>closeListen to the close button click event and perform the deletion operation.'
},
- 'codeFiles': ['closable.vue']
+ 'codeFiles': ['delete.vue']
},
{
'demoId': 'create',
@@ -95,12 +96,19 @@ export default {
'name': 'tag',
'type': 'component',
'props': [
+ {
+ 'name': 'before-delete',
+ 'type': '(close: () => void) => void',
+ 'defaultValue': '',
+ 'desc': { 'zh-CN': '删除前回调函数', 'en-US': 'Delete callback function before deletion' },
+ 'demoId': 'delete'
+ },
{
'name': 'closable',
'type': 'boolean',
'defaultValue': 'false',
'desc': { 'zh-CN': '是否可关闭', 'en-US': 'Can be disabled' },
- 'demoId': 'closable'
+ 'demoId': 'delete'
},
{
'name': 'color',
@@ -189,7 +197,7 @@ export default {
'zh-CN': '点击关闭按钮时触发的事件',
'en-US': 'Event triggered when the close button is clicked'
},
- 'demoId': 'closable'
+ 'demoId': 'delete'
}
],
'slots': [
diff --git a/packages/vue/src/tag/src/pc.vue b/packages/vue/src/tag/src/pc.vue
index 286bfc131..501894544 100644
--- a/packages/vue/src/tag/src/pc.vue
+++ b/packages/vue/src/tag/src/pc.vue
@@ -37,10 +37,7 @@ export default defineComponent({
]
const tagElement = (
-
+
{value ? {value} : slots.default && slots.default()}
{closable &&