mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-11-21 01:13:16 +08:00
fix: vite & type & docs
This commit is contained in:
parent
b3a1eb12fa
commit
453270d15f
@ -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
|
||||
|
@ -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`}>
|
||||
|
@ -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>
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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 |
|
||||
|
@ -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 |
|
||||
|
Loading…
Reference in New Issue
Block a user