Skip to content

Commit

Permalink
chore: fix compile
Browse files Browse the repository at this point in the history
  • Loading branch information
sendya committed Jan 7, 2021
1 parent 2b55648 commit b9508ae
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ant-design-vue/pro-layout",
"version": "3.0.0-alpha.1",
"version": "3.0.0-alpha.2",
"main": "./lib/index.js",
"module": "./es/index.js",
"sideEffects": false,
Expand Down Expand Up @@ -32,6 +32,7 @@
"@babel/plugin-proposal-export-default-from": "^7.12.1",
"@babel/plugin-transform-modules-commonjs": "^7.12.1",
"@babel/plugin-transform-object-assign": "^7.12.1",
"@babel/plugin-transform-runtime": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"@types/fs-extra": "^9.0.6",
"@types/jest": "^24.0.17",
Expand Down
10 changes: 5 additions & 5 deletions src/BasicLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { computed, FunctionalComponent, CSSProperties, VNodeChild } from 'vue';
import { computed, FunctionalComponent, CSSProperties, VNodeChild, VNode } from 'vue';
import 'ant-design-vue/es/layout/style';
import Layout from 'ant-design-vue/es/layout';
import { withInstall } from 'ant-design-vue/es/_util/type';
Expand Down Expand Up @@ -100,7 +100,7 @@ const ProLayout: FunctionalComponent<BasicLayoutProps> = (props, { emit, slots,
props: BasicLayoutProps & {
hasSiderMenu: boolean;
customHeaderRender: VNodeChild | false;
rightContentRender: VNodeChild | false;
rightContentRender: VNodeChild | VNode | false;
},
matchMenuKeys: string[],
): RenderVNodeType => {
Expand All @@ -109,7 +109,7 @@ const ProLayout: FunctionalComponent<BasicLayoutProps> = (props, { emit, slots,
}
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 headerDom = headerRender(
{
Expand All @@ -119,8 +119,8 @@ const ProLayout: FunctionalComponent<BasicLayoutProps> = (props, { emit, slots,
isMobile,
collapsed,
onCollapse,
onSelect: handleSelect,
onOpenChange: handleOpenChange,
// onSelect: handleSelect,
// onOpenChange: handleOpenChange,
customHeaderRender,
rightContentRender,
theme: (navTheme || 'dark').toLocaleLowerCase().includes('dark') ? 'dark' : 'light',
Expand Down
4 changes: 2 additions & 2 deletions src/SiderMenu/BaseMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const renderSubMenu = (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;
return hasChild ? renderSubMenu(item, i18nRender) : renderMenuItem(item, i18nRender);
}
Expand Down Expand Up @@ -193,7 +193,7 @@ export default defineComponent({
>
{props.menuData &&
props.menuData.map(menu => {
if (menu.hidden) {
if (menu.meta.hidden) {
return null;
}
return renderMenu(menu, i18n.value);
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useMergedState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export default function useControlledState<T, R = T>(
},
): [R, (value: T) => void] {
const triggerChange = () => {};
return [option.value, triggerChange];
return [null, triggerChange];
}
9 changes: 9 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,15 @@
resolve "^1.8.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":
version "7.2.0"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.2.0.tgz#566bc43f7d0aedc880eaddbd29168d0f248966ea"
Expand Down

0 comments on commit b9508ae

Please sign in to comment.