Skip to content

Commit

Permalink
build: 3.2.0 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
sendya committed Apr 6, 2022
1 parent cc71e4c commit fe8313e
Show file tree
Hide file tree
Showing 46 changed files with 934 additions and 930 deletions.
10 changes: 5 additions & 5 deletions packages/pro-layout/examples/App.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<script setup lang="ts">
import { RouterView } from 'vue-router'
import { ConfigProvider as AConfigProvider } from 'ant-design-vue'
import { RouterView } from 'vue-router';
import { ConfigProvider as AConfigProvider } from 'ant-design-vue';
const getPopupContainer = (triggerNode: HTMLElement): HTMLElement => {
// if (dialogContext) {
// return dialogContext.getDialogWrap()
// }
console.log('getPopupContainer', triggerNode)
return document.body
}
console.log('getPopupContainer', triggerNode);
return document.body;
};
</script>

<template>
Expand Down
20 changes: 10 additions & 10 deletions packages/pro-layout/examples/icons.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import * as Icons from '@ant-design/icons-vue/es'
import type { App } from 'vue'
import type { IconType } from '@ant-design/icons-vue/es/components/Icon'
import * as Icons from '@ant-design/icons-vue/es';
import type { App } from 'vue';
import type { IconType } from '@ant-design/icons-vue/es/components/Icon';

type AllIcon = {
[key: string]: IconType
}
[key: string]: IconType;
};

export const filterIcons = ['default', 'createFromIconfontCN', 'getTwoToneColor', 'setTwoToneColor']
export const filterIcons = ['default', 'createFromIconfontCN', 'getTwoToneColor', 'setTwoToneColor'];

export default (app: App) => {
const allIcon: AllIcon = Icons as any
const allIcon: AllIcon = Icons as any;
Object.keys(Icons)
.filter((k) => !filterIcons.includes(k))
.forEach((k) => {
app.component(allIcon[k].displayName, allIcon[k])
})
}
app.component(allIcon[k].displayName, allIcon[k]);
});
};
58 changes: 29 additions & 29 deletions packages/pro-layout/examples/layouts/BasicLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@
</template>

<script lang="ts">
import { computed, defineComponent, reactive, ref, watchEffect, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { message, Button, Input, Switch, Select, Avatar, Space, Badge, Menu } from 'ant-design-vue'
import { getMenuData, clearMenuItem, WaterMark, FooterToolbar } from '@ant-design-vue/pro-layout'
import type { RouteContextProps } from '@ant-design-vue/pro-layout'
import { computed, defineComponent, reactive, ref, watchEffect, onMounted } from 'vue';
import { useRouter } from 'vue-router';
import { message, Button, Input, Switch, Select, Avatar, Space, Badge, Menu } from 'ant-design-vue';
import { getMenuData, clearMenuItem, WaterMark, FooterToolbar } from '@ant-design-vue/pro-layout';
import type { RouteContextProps } from '@ant-design-vue/pro-layout';
const i18n = (t: string) => t
const i18n = (t: string) => t;
export default defineComponent({
name: 'BasicLayout',
Expand All @@ -96,17 +96,17 @@ export default defineComponent({
[Menu.Item.name]: Menu.Item,
},
setup() {
const loading = ref(false)
const watermarkContent = ref('Pro Layout')
const router = useRouter()
const { menuData } = getMenuData(clearMenuItem(router.getRoutes()))
const loading = ref(false);
const watermarkContent = ref('Pro Layout');
const router = useRouter();
const { menuData } = getMenuData(clearMenuItem(router.getRoutes()));
const baseState = reactive<Omit<RouteContextProps, 'menuData'>>({
selectedKeys: [],
openKeys: [],
// default
collapsed: false,
})
});
const state = reactive({
menuData,
Expand All @@ -117,39 +117,39 @@ export default defineComponent({
layout: 'side',
fixSiderbar: true,
fixedHeader: true,
})
});
const breadcrumb = computed(() =>
router.currentRoute.value.matched.concat().map((item) => {
return {
path: item.path,
breadcrumbName: item.meta.title || '',
}
};
})
)
);
const handleCollapsed = () => {
baseState.collapsed = !baseState.collapsed
}
baseState.collapsed = !baseState.collapsed;
};
watchEffect(() => {
if (router.currentRoute) {
const matched = router.currentRoute.value.matched.concat()
baseState.selectedKeys = matched.filter((r) => r.name !== 'index').map((r) => r.path)
baseState.openKeys = matched.filter((r) => r.path !== router.currentRoute.value.path).map((r) => r.path)
const matched = router.currentRoute.value.matched.concat();
baseState.selectedKeys = matched.filter((r) => r.name !== 'index').map((r) => r.path);
baseState.openKeys = matched.filter((r) => r.path !== router.currentRoute.value.path).map((r) => r.path);
}
})
});
function handlePageLoadingClick() {
loading.value = true
loading.value = true;
setTimeout(() => {
loading.value = false
}, 2000)
loading.value = false;
}, 2000);
}
onMounted(() => {
setTimeout(() => {
watermarkContent.value = 'New Mark'
}, 2000)
})
watermarkContent.value = 'New Mark';
}, 2000);
});
return {
i18n,
Expand All @@ -162,9 +162,9 @@ export default defineComponent({
handlePageLoadingClick,
handleCollapsed,
handleSearch: () => {
message.info('search..')
message.info('search..');
},
}
};
},
})
});
</script>
42 changes: 21 additions & 21 deletions packages/pro-layout/examples/layouts/NestedLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,23 @@
</template>

<script setup lang="ts">
import { computed, reactive, ref, watchEffect, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { Avatar as AAvatar, Breadcrumb as ABreadcrumb, BreadcrumbItem as ABreadcrumbItem } from 'ant-design-vue'
import { getMenuData, clearMenuItem, WaterMark } from '@ant-design-vue/pro-layout'
import type { RouteContextProps } from '@ant-design-vue/pro-layout'
import { computed, reactive, ref, watchEffect, onMounted } from 'vue';
import { useRouter } from 'vue-router';
import { Avatar as AAvatar, Breadcrumb as ABreadcrumb, BreadcrumbItem as ABreadcrumbItem } from 'ant-design-vue';
import { getMenuData, clearMenuItem, WaterMark } from '@ant-design-vue/pro-layout';
import type { RouteContextProps } from '@ant-design-vue/pro-layout';
const loading = ref(false)
const watermarkContent = ref('Pro Layout')
const router = useRouter()
const { menuData } = getMenuData(clearMenuItem(router.getRoutes()))
const loading = ref(false);
const watermarkContent = ref('Pro Layout');
const router = useRouter();
const { menuData } = getMenuData(clearMenuItem(router.getRoutes()));
const routes = menuData.map((item) => {
return {
...item,
children: null,
}
})
};
});
const baseState = reactive<Omit<RouteContextProps, 'menuData'>>({
selectedKeys: ['/dashboard'],
Expand All @@ -90,7 +90,7 @@ const baseState = reactive<Omit<RouteContextProps, 'menuData'>>({
childrenSelectedKeys: [],
childrenOpenKeys: [],
collapsed: false,
})
});
const breadcrumb = computed(() =>
router.currentRoute.value.matched.concat().map((item) => {
Expand All @@ -99,21 +99,21 @@ const breadcrumb = computed(() =>
icon: item.meta.icon,
params: item.meta?.params,
breadcrumbName: item.meta.title || '',
}
};
})
)
);
watchEffect(() => {
if (router.currentRoute) {
const matched = router.currentRoute.value.matched.concat()
baseState.childrenSelectedKeys = matched.filter((r) => r.name !== 'index').map((r) => r.path)
baseState.childrenOpenKeys = matched.filter((r) => r.path !== router.currentRoute.value.path).map((r) => r.path)
const matched = router.currentRoute.value.matched.concat();
baseState.childrenSelectedKeys = matched.filter((r) => r.name !== 'index').map((r) => r.path);
baseState.childrenOpenKeys = matched.filter((r) => r.path !== router.currentRoute.value.path).map((r) => r.path);
}
})
});
onMounted(() => {
setTimeout(() => {
watermarkContent.value = 'New Mark'
}, 2000)
})
watermarkContent.value = 'New Mark';
}, 2000);
});
</script>
18 changes: 9 additions & 9 deletions packages/pro-layout/examples/main.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import '@ant-design-vue/pro-layout/style.less'
import '@ant-design-vue/pro-layout/style.less';

import { createApp } from 'vue'
import ProLayout, { PageContainer } from '@ant-design-vue/pro-layout'
import App from './App.vue'
import router from './router'
import icons from './icons'
import { createApp } from 'vue';
import ProLayout, { PageContainer } from '@ant-design-vue/pro-layout';
import App from './App.vue';
import router from './router';
import icons from './icons';

const app = createApp(App)
const app = createApp(App);

app.use(router)
app.use(router);

app.use(ProLayout).use(PageContainer).use(icons).mount('#app')
app.use(ProLayout).use(PageContainer).use(icons).mount('#app');
16 changes: 8 additions & 8 deletions packages/pro-layout/examples/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createRouter, createWebHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'
import BasicLayout from '../layouts/BasicLayout.vue'
import BlankLayout from '../layouts/BlankLayout.vue'
import WelcomePage from '../views/Hello.vue'
import { createRouter, createWebHistory } from 'vue-router';
import type { RouteRecordRaw } from 'vue-router';
import BasicLayout from '../layouts/BasicLayout.vue';
import BlankLayout from '../layouts/BlankLayout.vue';
import WelcomePage from '../views/Hello.vue';

const routes: RouteRecordRaw[] = [
{
Expand Down Expand Up @@ -112,11 +112,11 @@ const routes: RouteRecordRaw[] = [
},
],
},
]
];

const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes,
})
});

export default router
export default router;
16 changes: 8 additions & 8 deletions packages/pro-layout/examples/views/DynamicPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
import { Button, message } from 'ant-design-vue'
import { defineComponent, ref } from 'vue';
import { Button, message } from 'ant-design-vue';
export default defineComponent({
components: {
[Button.name]: Button,
},
setup() {
const text = ref<string>('1')
const text = ref<string>('1');
const handleClick = () => {
message.info('clicked')
text.value = `${Math.random()}`
}
message.info('clicked');
text.value = `${Math.random()}`;
};
return {
handleClick,
text,
}
};
},
})
});
</script>
14 changes: 7 additions & 7 deletions packages/pro-layout/examples/views/Hello.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
</template>

<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'
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')
message.info('BackHome button clicked!')
}
console.log('info');
message.info('BackHome button clicked!');
};
</script>
8 changes: 4 additions & 4 deletions packages/pro-layout/examples/views/MyPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { Button, Tag, Result } from 'ant-design-vue'
import { defineComponent } from 'vue';
import { Button, Tag, Result } from 'ant-design-vue';
export default defineComponent({
components: {
Expand All @@ -31,7 +31,7 @@ export default defineComponent({
[Result.name]: Result,
},
setup() {
return {}
return {};
},
})
});
</script>
16 changes: 8 additions & 8 deletions packages/pro-layout/examples/views/TestPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
import { Button, message } from 'ant-design-vue'
import { defineComponent, ref } from 'vue';
import { Button, message } from 'ant-design-vue';
export default defineComponent({
components: {
[Button.name]: Button,
},
setup() {
const text = ref<string>('1')
const text = ref<string>('1');
const handleClick = () => {
message.info('clicked')
text.value = `${Math.random()}`
}
message.info('clicked');
text.value = `${Math.random()}`;
};
return {
handleClick,
text,
}
};
},
})
});
</script>
Loading

0 comments on commit fe8313e

Please sign in to comment.