Skip to content

Commit

Permalink
fix: layout style import
Browse files Browse the repository at this point in the history
  • Loading branch information
sendya committed Mar 14, 2022
1 parent d1f1310 commit 83dfbc4
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion packages/pro-layout/examples/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'ant-design-vue/dist/antd.less'
import '@ant-design-vue/pro-layout/style.less'

import { createApp } from 'vue'
import ProLayout, { PageContainer } from '@ant-design-vue/pro-layout'
Expand Down
3 changes: 3 additions & 0 deletions packages/pro-layout/examples/views/Hello.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

<script lang="ts" setup>
import { Result as AResult, Button as AButton, message } from 'ant-design-vue'
import 'ant-design-vue/es/result/style'
import 'ant-design-vue/es/button/style'
import 'ant-design-vue/es/message/style'
const handleClick = () => {
console.log('info')
Expand Down
2 changes: 1 addition & 1 deletion packages/pro-layout/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ant-design-vue/pro-layout",
"version": "3.2.0-alpha.2",
"version": "3.2.0-alpha.3",
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",
Expand Down
6 changes: 3 additions & 3 deletions packages/pro-layout/src/BasicLayout.less
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@import './default.less';

@import (reference) 'ant-design-vue/es/layout/style/index.less';
@import (reference) 'ant-design-vue/es/menu/style/index.less';
@import (reference) 'ant-design-vue/es/drawer/style/index.less';
@import 'ant-design-vue/es/layout/style/index.less';
@import 'ant-design-vue/es/menu/style/index.less';
@import 'ant-design-vue/es/drawer/style/index.less';

.@{basicLayout-prefix-cls} {
// BFC
Expand Down
1 change: 0 additions & 1 deletion packages/pro-layout/src/BasicLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ const ProLayout = defineComponent({
'menuClick',
],
setup(props, { emit, slots }) {
console.log('props', props)
const isTop = computed(() => props.layout === 'top')
const hasSide = computed(() => props.layout === 'mix' || props.layout === 'side' || false)
const hasSplitMenu = computed(() => props.layout === 'mix' && props.splitMenus)
Expand Down
2 changes: 1 addition & 1 deletion packages/pro-layout/src/components/GlobalFooter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default defineComponent({
required: true,
},
copyright: {
type: [Object, Function] as PropType<CustomRender>,
type: [Object, Function, String, Boolean] as PropType<WithFalse<CustomRender>>,
default: () => undefined,
},
prefixCls: {
Expand Down
11 changes: 5 additions & 6 deletions packages/pro-layout/src/components/PageContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import omit from 'omit.js'
import PageHeader, { pageHeaderProps } from 'ant-design-vue/es/page-header'
import { Tabs, Affix, Spin } from 'ant-design-vue'
import type { TabPaneProps } from './interfaces/TabPane'
import type { TabBarExtraContent, TabsProps } from './interfaces/Tabs'
import type { TabBarExtraContent /*, TabsProps */ } from './interfaces/Tabs'
import type { AffixProps } from './interfaces/Affix'
/* replace antd ts define end */
import { type RouteContextProps, useRouteContext } from '../../RouteContext'
Expand All @@ -25,7 +25,6 @@ import 'ant-design-vue/es/tabs/style'
import 'ant-design-vue/es/spin/style'
import GridContent from '../GridContent'
import FooterToolbar from '../FooterToolbar'
import PropTypes from 'ant-design-vue/es/_util/vue-types'
import { withInstall } from 'ant-design-vue/es/_util/type'
import type { CustomRender } from '../../typings'
import type { DefaultPropRender, PageHeaderRender } from '../../RenderTypings'
Expand Down Expand Up @@ -65,9 +64,9 @@ export const pageHeaderTabConfig = {
/**
* @name 固定 PageHeader 到页面顶部
*/
fixedHeader: Boolean,//PropTypes.looseBool,
fixedHeader: Boolean, //PropTypes.looseBool,
// events
onTabChange: Function,//PropTypes.func,
onTabChange: Function, //PropTypes.func,
}
export type PageHeaderTabConfig = Partial<ExtractPropTypes<typeof pageHeaderTabConfig>>

Expand All @@ -77,7 +76,7 @@ export const pageContainerProps = {
prefixCls: {
type: String,
default: 'ant-pro',
},//PropTypes.string.def('ant-pro'),
}, //PropTypes.string.def('ant-pro'),
title: {
type: [Object, String, Boolean, Function] as PropType<DefaultPropRender>,
default: () => null,
Expand Down Expand Up @@ -111,7 +110,7 @@ export const pageContainerProps = {
ghost: {
type: Boolean,
default: () => undefined,
},//PropTypes.looseBool,
}, //PropTypes.looseBool,
loading: {
type: Boolean,
default: () => undefined,
Expand Down
2 changes: 1 addition & 1 deletion packages/pro-layout/src/default.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import (reference) 'ant-design-vue/es/style/themes/default.less';
@import 'ant-design-vue/es/style/themes/default.less';

@basicLayout-prefix-cls: ~'@{ant-prefix}-pro-basicLayout';
@pro-layout-header-height: 48px;
5 changes: 1 addition & 4 deletions packages/pro-layout/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@ import vueJsx from '@vitejs/plugin-vue-jsx'
import typescript from '@rollup/plugin-typescript'
import lessCopy from '@shared/vite-plugin-less-copy'

const srcDir = fileURLToPath(new URL('./src', import.meta.url))
const distDir = fileURLToPath(new URL('./dist', import.meta.url))

// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx(), lessCopy()],
resolve: {
alias: {
'@ant-design-vue/pro-layout': srcDir,
'@ant-design-vue/pro-layout': fileURLToPath(new URL('./src', import.meta.url)),
'@': fileURLToPath(new URL('./examples', import.meta.url)),
},
},
Expand Down

0 comments on commit 83dfbc4

Please sign in to comment.