Skip to content

Commit

Permalink
fix: #152 Menu provide,inject undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
sendya committed Sep 10, 2021
1 parent 45f4c85 commit b215b43
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 3,167 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ant-design-vue/pro-layout",
"version": "3.1.0-beta.5",
"version": "3.1.0-beta.6",
"license": "MIT",
"files": [
"dist"
Expand Down Expand Up @@ -63,10 +63,10 @@
"tsc": "^2.0.3",
"tsup": "^4.12.5",
"typescript": "^4.3.2",
"vite": "^2.4.0",
"vite": "^2.5.6",
"vite-dts": "^1.0.3",
"vite-plugin-dts": "^0.5.2",
"vue-tsc": "^0.0.24"
"vue-tsc": "^0.3.0"
},
"description": "Ant Design Pro Layout of Vue, easy to use pro scaffolding."
}
2 changes: 1 addition & 1 deletion src/BasicLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { computed, reactive, unref, defineComponent, toRefs } from 'vue';
import type { CSSProperties, PropType, ExtractPropTypes } from 'vue';

import 'ant-design-vue/es/layout/style';
import Layout from 'ant-design-vue/es/layout';
import { Layout } from 'ant-design-vue';
import { withInstall } from 'ant-design-vue/es/_util/type';
import useMediaQuery from './hooks/useMediaQuery';

Expand Down
2 changes: 1 addition & 1 deletion src/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineComponent, computed, toRefs } from 'vue';
import type { PropType, ExtractPropTypes } from 'vue';
import type { RouteRecordRaw } from 'vue-router';
import 'ant-design-vue/es/layout/style';
import Layout from 'ant-design-vue/es/layout';
import { Layout } from 'ant-design-vue';

import { GlobalHeader } from './GlobalHeader';
import type { GlobalHeaderProps } from './GlobalHeader';
Expand Down
6 changes: 2 additions & 4 deletions src/PageContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ import {
ExtractPropTypes,
} from 'vue';
/* replace antd ts define */
import omit from 'omit.js';
import { withInstall } from 'ant-design-vue/es/_util/type';
import PageHeader, { pageHeaderProps } from 'ant-design-vue/es/page-header';
import Tabs from 'ant-design-vue/es/tabs';
import Affix from 'ant-design-vue/es/affix';
import Spin from 'ant-design-vue/es/spin';
import omit from 'omit.js';
import { Tabs, Affix, Spin, } from 'ant-design-vue';
import { TabPaneProps } from './interfaces/TabPane';
import { TabBarExtraContent, TabsProps } from './interfaces/Tabs';
import { AffixProps } from './interfaces/Affix';
Expand Down
2 changes: 1 addition & 1 deletion src/SiderMenu/BaseMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from 'vue';
import { createFromIconfontCN } from '@ant-design/icons-vue';
import 'ant-design-vue/es/menu/style';
import Menu from 'ant-design-vue/es/menu';
import { Menu } from 'ant-design-vue';
import { defaultSettingProps, defaultSettings } from '../defaultSettings';
import { isImg, isUrl } from '../utils';
import { MenuMode } from './typings';
Expand Down
3 changes: 1 addition & 2 deletions src/SiderMenu/SiderMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import {
unref,
} from 'vue';
import 'ant-design-vue/es/layout/style';
import Layout from 'ant-design-vue/es/layout';
import 'ant-design-vue/es/menu/style';
import Menu from 'ant-design-vue/es/menu';
import { Layout, Menu } from 'ant-design-vue';
import { MenuUnfoldOutlined, MenuFoldOutlined } from '@ant-design/icons-vue';
import BaseMenu, { baseMenuProps } from './BaseMenu';
import { WithFalse, CustomRender } from '../typings';
Expand Down
2 changes: 1 addition & 1 deletion src/SiderMenu/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FunctionalComponent as FC } from 'vue';

import 'ant-design-vue/es/drawer/style';
import Drawer from 'ant-design-vue/es/drawer';
import { Drawer } from 'ant-design-vue';

import SiderMenu, { siderMenuProps, SiderMenuProps, PrivateSiderMenuProps } from './SiderMenu';

Expand Down
5 changes: 3 additions & 2 deletions src/SiderMenu/typings.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { VNodeChild, CSSProperties, HTMLAttributes } from 'vue';
export { MenuMode, MenuTheme } from 'ant-design-vue/es/menu/src/interface';
import type { VNodeChild, CSSProperties, HTMLAttributes } from 'vue';

export type { MenuMode, MenuTheme } from 'ant-design-vue/es/menu/src/interface';

export interface MenuInfo {
key: string | number;
Expand Down
1 change: 0 additions & 1 deletion src/TopNavHeader/index.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import 'ant-design-vue/es/style/themes/default.less';
@import '../BasicLayout.less';

@top-nav-header-prefix-cls: ~'@{ant-prefix}-pro-top-nav-header';
Expand Down
18 changes: 14 additions & 4 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default defineConfig({
alias: {
'@ant-design-vue/pro-layout': resolve(__dirname, 'src'),
'@': resolve(__dirname, 'src'),
'vue': 'vue/dist/vue.esm-bundler.js',
},
},
build: {
Expand All @@ -27,23 +28,32 @@ export default defineConfig({
name: 'ProLayout',
},
rollupOptions: {
external: ['vue', 'vue-router', '@ant-design/icons-vue', 'ant-design-vue', 'antd', 'moment'],

external: [
'vue',
'vue-router',
'@ant-design/icons-vue',
'ant-design-vue',
'antd',
'moment',
],
output: {
exports: 'named',
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
vue: 'Vue',
'vue-router': 'VueRouter',
moment: 'moment',
'ant-design-vue': 'antd',
'ant-design-vue': 'antDesignVue',
'@ant-design/icons-vue': 'iconsVue',
'antd': 'antd',
moment: 'moment',
},
},
},
},
optimizeDeps: {
include: ['ant-design-vue/es', '@ant-design/icons-vue', 'lodash-es'],
include: ['ant-design-vue', '@ant-design/icons-vue', 'lodash-es'],
},
css: {
postcss: {},
Expand Down
Loading

0 comments on commit b215b43

Please sign in to comment.