fix: vite & type & docs

This commit is contained in:
07akioni 2023-12-03 19:51:47 +08:00
parent b3a1eb12fa
commit 453270d15f
6 changed files with 32 additions and 26 deletions

View File

@ -1,22 +1,20 @@
const transformIndexHtml = (code) => {
switch (process.env.NODE_ENV) {
case 'production':
return code.replace(/__INDEX__/, '/demo/index.prod.js')
return code.replace(/__INDEX__/, 'demo/index.prod.js')
default:
return code.replace(/__INDEX__/, '/demo/index.dev.js')
return code.replace(/__INDEX__/, 'demo/index.dev.js')
}
}
const demoIndexTransFormPlugin = {
name: 'demo-transform',
enforce: 'pre',
// vite build is production will not invoke `transformIndexHtml`
transform (code, id) {
if (id.endsWith('.html')) {
return { code: transformIndexHtml(code), map: null }
transformIndexHtml: {
order: 'pre',
handler: (code) => {
return transformIndexHtml(code)
}
}
},
transformIndexHtml
}
module.exports = demoIndexTransFormPlugin

View File

@ -460,16 +460,15 @@ export default defineComponent({
{resolveWrappedSlot(
$slots.header,
(children) =>
children && [
children && (
<div
class={`${clsPrefix}-base-select-menu__header`}
data-header
key="header"
>
{children}
</div>,
<NFocusDetector onFocus={this.onTabOut} key="focus-detector" />
]
</div>
)
)}
{this.loading ? (
<div class={`${clsPrefix}-base-select-menu__loading`}>

View File

@ -157,7 +157,10 @@ export default defineComponent({
{this.showArrow
? renderArrow({
clsPrefix,
arrowStyle: this.arrowStyle
arrowStyle: this.arrowStyle,
arrowClass: undefined,
arrowWrapperClass: undefined,
arrowWrapperStyle: undefined
})
: null}
</div>

View File

@ -156,8 +156,14 @@ export default defineComponent({
const { relatedTarget } = e
if (
relatedTarget &&
!happensIn({ target: relatedTarget }, 'dropdownOption') &&
!happensIn({ target: relatedTarget }, 'scrollbarRail')
!happensIn(
{ target: relatedTarget, currentTarget: relatedTarget },
'dropdownOption'
) &&
!happensIn(
{ target: relatedTarget, currentTarget: relatedTarget },
'scrollbarRail'
)
) {
hoverKeyRef.value = null
}

View File

@ -35,7 +35,7 @@ For other props, see [Popover](popover#Popover-Props)
### Popselect Slots
| Name | Parameters | Description | Version |
| ------ | ---------- | -------------------------------------- | ------- |
| header | `()` | Header menu slot. | NEXT |
| ------ | ---------- | -------------------------------------- | ------------ |
| header | `()` | Header menu slot. | NEXT_VERSION |
| action | `()` | Options menu slot. | 2.22.0 |
| empty | `()` | Empty state slot for the options menu. | 2.22.0 |

View File

@ -35,7 +35,7 @@ slot.vue
### Popselect Slots
| 名称 | 参数 | 说明 | 版本 |
| ------ | ---- | ------------------- | ------ |
| header | `()` | 菜单头部区域的 slot | 2.22.0 |
| ------ | ---- | ------------------- | ------------ |
| header | `()` | 菜单头部区域的 slot | NEXT_VERSION |
| action | `()` | 菜单操作区域的 slot | 2.22.0 |
| empty | `()` | 菜单无数据时的 slot | 2.22.0 |