mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-18 12:34:25 +08:00
feat(pop-select): add show/hide event
This commit is contained in:
parent
73c97cc816
commit
a0774cbe33
@ -51,15 +51,22 @@ export default {
|
|||||||
const slots = context.scopedSlots
|
const slots = context.scopedSlots
|
||||||
const activator = slots.activator || slots.default
|
const activator = slots.activator || slots.default
|
||||||
const controller = context.props.controller || {}
|
const controller = context.props.controller || {}
|
||||||
return h(
|
const onHide = context.listeners.hide || (() => {})
|
||||||
NPopover, {
|
const onShow = context.listeners.show || (() => {})
|
||||||
|
|
||||||
|
return h(NPopover, {
|
||||||
props: {
|
props: {
|
||||||
trigger: 'click',
|
trigger: 'click',
|
||||||
controller
|
controller
|
||||||
},
|
},
|
||||||
|
on: {
|
||||||
|
show: onShow,
|
||||||
|
hide: onHide
|
||||||
|
},
|
||||||
scopedSlots: {
|
scopedSlots: {
|
||||||
activator: () => activator(),
|
activator: () => activator(),
|
||||||
default: () => h(NPopselectPanel, {
|
default: () =>
|
||||||
|
h(NPopselectPanel, {
|
||||||
props: {
|
props: {
|
||||||
...context.props,
|
...context.props,
|
||||||
controller
|
controller
|
||||||
|
Loading…
Reference in New Issue
Block a user