Commit b9508ae9 authored by Sendya's avatar Sendya

chore: fix compile

parent 2b556487
{ {
"name": "@ant-design-vue/pro-layout", "name": "@ant-design-vue/pro-layout",
"version": "3.0.0-alpha.1", "version": "3.0.0-alpha.2",
"main": "./lib/index.js", "main": "./lib/index.js",
"module": "./es/index.js", "module": "./es/index.js",
"sideEffects": false, "sideEffects": false,
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
"@babel/plugin-proposal-export-default-from": "^7.12.1", "@babel/plugin-proposal-export-default-from": "^7.12.1",
"@babel/plugin-transform-modules-commonjs": "^7.12.1", "@babel/plugin-transform-modules-commonjs": "^7.12.1",
"@babel/plugin-transform-object-assign": "^7.12.1", "@babel/plugin-transform-object-assign": "^7.12.1",
"@babel/plugin-transform-runtime": "^7.12.10",
"@babel/preset-env": "^7.12.11", "@babel/preset-env": "^7.12.11",
"@types/fs-extra": "^9.0.6", "@types/fs-extra": "^9.0.6",
"@types/jest": "^24.0.17", "@types/jest": "^24.0.17",
......
import { computed, FunctionalComponent, CSSProperties, VNodeChild } from 'vue'; import { computed, FunctionalComponent, CSSProperties, VNodeChild, VNode } from 'vue';
import 'ant-design-vue/es/layout/style'; import 'ant-design-vue/es/layout/style';
import Layout from 'ant-design-vue/es/layout'; import Layout from 'ant-design-vue/es/layout';
import { withInstall } from 'ant-design-vue/es/_util/type'; import { withInstall } from 'ant-design-vue/es/_util/type';
...@@ -100,7 +100,7 @@ const ProLayout: FunctionalComponent<BasicLayoutProps> = (props, { emit, slots, ...@@ -100,7 +100,7 @@ const ProLayout: FunctionalComponent<BasicLayoutProps> = (props, { emit, slots,
props: BasicLayoutProps & { props: BasicLayoutProps & {
hasSiderMenu: boolean; hasSiderMenu: boolean;
customHeaderRender: VNodeChild | false; customHeaderRender: VNodeChild | false;
rightContentRender: VNodeChild | false; rightContentRender: VNodeChild | VNode | false;
}, },
matchMenuKeys: string[], matchMenuKeys: string[],
): RenderVNodeType => { ): RenderVNodeType => {
...@@ -109,7 +109,7 @@ const ProLayout: FunctionalComponent<BasicLayoutProps> = (props, { emit, slots, ...@@ -109,7 +109,7 @@ const ProLayout: FunctionalComponent<BasicLayoutProps> = (props, { emit, slots,
} }
return <Header matchMenuKeys={matchMenuKeys} {...props} headerHeight={48} />; return <Header matchMenuKeys={matchMenuKeys} {...props} headerHeight={48} />;
}; };
const rightContentRender = getComponentOrSlot(props, slots, 'rightContentRender'); const rightContentRender = getComponentOrSlot(props, slots, 'rightContentRender') as any;
const customHeaderRender = getComponentOrSlot(props, slots, 'headerRender'); const customHeaderRender = getComponentOrSlot(props, slots, 'headerRender');
const headerDom = headerRender( const headerDom = headerRender(
{ {
...@@ -119,8 +119,8 @@ const ProLayout: FunctionalComponent<BasicLayoutProps> = (props, { emit, slots, ...@@ -119,8 +119,8 @@ const ProLayout: FunctionalComponent<BasicLayoutProps> = (props, { emit, slots,
isMobile, isMobile,
collapsed, collapsed,
onCollapse, onCollapse,
onSelect: handleSelect, // onSelect: handleSelect,
onOpenChange: handleOpenChange, // onOpenChange: handleOpenChange,
customHeaderRender, customHeaderRender,
rightContentRender, rightContentRender,
theme: (navTheme || 'dark').toLocaleLowerCase().includes('dark') ? 'dark' : 'light', theme: (navTheme || 'dark').toLocaleLowerCase().includes('dark') ? 'dark' : 'light',
......
...@@ -116,7 +116,7 @@ const renderSubMenu = (item: MenuDataItem, i18nRender: FormatMessage) => { ...@@ -116,7 +116,7 @@ const renderSubMenu = (item: MenuDataItem, i18nRender: FormatMessage) => {
}; };
const renderMenu = (item: MenuDataItem, i18nRender: FormatMessage) => { const renderMenu = (item: MenuDataItem, i18nRender: FormatMessage) => {
if (item && !item.hidden) { if (item && !item.meta.hidden) {
const hasChild = item.children && !item.meta?.hideChildInMenu; const hasChild = item.children && !item.meta?.hideChildInMenu;
return hasChild ? renderSubMenu(item, i18nRender) : renderMenuItem(item, i18nRender); return hasChild ? renderSubMenu(item, i18nRender) : renderMenuItem(item, i18nRender);
} }
...@@ -193,7 +193,7 @@ export default defineComponent({ ...@@ -193,7 +193,7 @@ export default defineComponent({
> >
{props.menuData && {props.menuData &&
props.menuData.map(menu => { props.menuData.map(menu => {
if (menu.hidden) { if (menu.meta.hidden) {
return null; return null;
} }
return renderMenu(menu, i18n.value); return renderMenu(menu, i18n.value);
......
...@@ -8,5 +8,5 @@ export default function useControlledState<T, R = T>( ...@@ -8,5 +8,5 @@ export default function useControlledState<T, R = T>(
}, },
): [R, (value: T) => void] { ): [R, (value: T) => void] {
const triggerChange = () => {}; const triggerChange = () => {};
return [option.value, triggerChange]; return [null, triggerChange];
} }
...@@ -1019,6 +1019,15 @@ ...@@ -1019,6 +1019,15 @@
resolve "^1.8.1" resolve "^1.8.1"
semver "^5.5.1" semver "^5.5.1"
"@babel/plugin-transform-runtime@^7.12.10":
version "7.12.10"
resolved "https://registry.npm.taobao.org/@babel/plugin-transform-runtime/download/@babel/plugin-transform-runtime-7.12.10.tgz?cache=0&sync_timestamp=1607569369088&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-runtime%2Fdownload%2F%40babel%2Fplugin-transform-runtime-7.12.10.tgz#af0fded4e846c4b37078e8e5d06deac6cd848562"
integrity sha1-rw/e1OhGxLNweOjl0G3qxs2EhWI=
dependencies:
"@babel/helper-module-imports" "^7.12.5"
"@babel/helper-plugin-utils" "^7.10.4"
semver "^5.5.1"
"@babel/plugin-transform-runtime@~7.2.0": "@babel/plugin-transform-runtime@~7.2.0":
version "7.2.0" version "7.2.0"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.2.0.tgz#566bc43f7d0aedc880eaddbd29168d0f248966ea" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.2.0.tgz#566bc43f7d0aedc880eaddbd29168d0f248966ea"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment