feat(pop-select): add show/hide event

This commit is contained in:
JiwenBai 2019-10-29 14:23:10 +08:00
parent 73c97cc816
commit a0774cbe33

View File

@ -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