Skip to content

Commit f76d6cb

Browse files
author
cole
committed
test: workflows
1 parent 48c8156 commit f76d6cb

File tree

22 files changed

+18
-67
lines changed

22 files changed

+18
-67
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/hooks/useAppShare.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { inject, provide } from 'vue'
22

3-
const BaseKey = Symbol('App')
3+
const BaseKey = Symbol('AppShare')
44

55
export function createAppShare (instance) {
66
provide(BaseKey, instance)

src/layout/compatible/base-layout/index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/layout/compatible/base-layout/BaseLayout.jsx renamed to src/layout/compatible/base-layout/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { computed, defineComponent, ref, unref } from 'vue'
22
import { Drawer } from 'ant-design-vue'
3-
import { getSlotVNode } from '@site-pro/utils'
3+
import { getSlotVNode, toPx } from '@site-pro/utils'
44
import { useConfigInject } from '@site-pro/hooks'
55
import { useSite } from '@site-pro/plugins'
66
import useStyle from './style'
@@ -45,7 +45,7 @@ export default defineComponent({
4545
function styleFn (width) {
4646
// 缓存 width border 1px
4747
siderWidth.value = width
48-
return { width: `${width}px` }
48+
return { width: toPx(width) }
4949
}
5050

5151
return () => {

src/layout/compatible/container/index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/layout/compatible/navbar/index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/layout/compatible/navbar/Navbar.jsx renamed to src/layout/compatible/navbar/index.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ export default defineComponent({
4040
emit('collapse', !props.collapsed)
4141
}
4242

43+
function getPopupContainer () {
44+
return getElement(popupContainer) || document.body
45+
}
46+
4347
return () => {
4448
const { router, collapsed } = props
4549

@@ -49,7 +53,7 @@ export default defineComponent({
4953

5054
return wrapSSR(
5155
<div class={[prefixCls.value, hashId.value]} {...attrs}>
52-
<ConfigProvider getPopupContainer={getElement.bind(null, popupContainer)}>
56+
<ConfigProvider getPopupContainer={getPopupContainer}>
5357
<div class={`${prefixCls.value}-popup-container`} ref={popupContainer}>
5458
<div class={`${prefixCls.value}-content`}>
5559
<div class={`${prefixCls.value}-left`}>

src/layout/compatible/sidebar/index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/layout/compatible/sidebar/Sidebar.jsx renamed to src/layout/compatible/sidebar/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { computed, defineComponent, Fragment, ref, unref, watch } from 'vue'
22
import { Menu, theme } from 'ant-design-vue'
3-
import { getSlotVNode } from '@site-pro/utils'
3+
import { getSlotVNode, toPx } from '@site-pro/utils'
44
import { useConfigInject } from '@site-pro/hooks'
55
import { dropRight, head, isFunction, isNil, last, reverse } from 'lodash-es'
66
import OutIcon from './OutIcon'
@@ -145,9 +145,9 @@ export default defineComponent({
145145
: controlHeightLG * 5 + level * 8
146146
// ----
147147
if (styleFn && isFunction(styleFn)) {
148-
return styleFn(width) || { width: `${width}px` }
148+
return styleFn(width) || { width: toPx(width) }
149149
}
150-
return { width: `${width}px` }
150+
return { width: toPx(width) }
151151
})
152152

153153
watch(() => props.route, (currentRoute) => {

src/layout/compatible/tags/index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/layout/compatible/tags/Tags.jsx renamed to src/layout/compatible/tags/index.jsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineComponent, nextTick, ref, unref, watch } from 'vue'
22
import { Button, ConfigProvider, Dropdown, Menu, theme } from 'ant-design-vue'
33
import { CloseCircleOutlined, LeftOutlined, RightOutlined } from '@ant-design/icons-vue'
4-
import { getElement } from '@site-pro/utils'
4+
import { getElement, toPx } from '@site-pro/utils'
55
import { useConfigInject, useGlobalProperties, useRefs } from '@site-pro/hooks'
66
import TagNode from './node'
77
import useShowTitle from '../../hooks/useShowTitle'
@@ -151,6 +151,10 @@ export default defineComponent({
151151
}
152152
}
153153

154+
function getPopupContainer () {
155+
return getElement(popupContainer) || document.body
156+
}
157+
154158
return () => {
155159
const { tags, route: currentRoute, homeName } = props
156160
const { sizeXXS } = unref(token)
@@ -161,7 +165,7 @@ export default defineComponent({
161165
const tagNodes = tags.map((item) => {
162166
const { name: key } = item || {}
163167
const tagProps = {
164-
style: { marginInlineEnd: `${sizeXXS}px` },
168+
style: { marginInlineEnd: toPx(sizeXXS) },
165169
color: currentRoute.name === key ? 'primary' : 'default',
166170
closable: key !== homeName,
167171
onClick: onClick(item),
@@ -198,7 +202,7 @@ export default defineComponent({
198202

199203
return wrapSSR(
200204
<div class={[prefixCls.value, hashId.value]} {...attrs}>
201-
<ConfigProvider getPopupContainer={getElement.bind(null, popupContainer)}>
205+
<ConfigProvider getPopupContainer={getPopupContainer}>
202206
<div class={`${prefixCls.value}-popup-container`} ref={popupContainer}>
203207
<div class={`${prefixCls.value}-content`}>
204208
<div

src/layout/compatible/tags/node/index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/layout/components/avatar/index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/layout/components/breadcrumb/index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/layout/components/fullscreen/index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/layout/components/language/index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)