Skip to content

Commit 628574c

Browse files
committed
refactor: use vite build
1 parent a93acee commit 628574c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2493
-16965
lines changed

.eslintrc.js

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
11
module.exports = {
2-
root: true,
32
env: {
4-
node: true,
3+
browser: true,
4+
es2021: true,
55
},
66
extends: [
7-
'plugin:vue/vue3-essential',
8-
'eslint:recommended',
9-
'@vue/typescript/recommended',
10-
'@vue/prettier',
11-
'@vue/prettier/@typescript-eslint',
7+
'airbnb-base',
8+
'plugin:@typescript-eslint/recommended',
9+
'plugin:vue/vue3-recommended',
10+
'plugin:prettier/recommended',
1211
],
1312
parserOptions: {
14-
ecmaVersion: 2020,
15-
// parser: '@typescript-eslint/parser',
13+
ecmaVersion: 12,
14+
parser: '@typescript-eslint/parser',
15+
sourceType: 'module',
16+
ecmaFeatures: {
17+
jsx: true,
18+
},
1619
},
20+
plugins: ['vue', '@typescript-eslint'],
1721
rules: {
22+
'import/extensions': 0,
23+
'import/no-unresolved': 0,
24+
'no-param-reassign': 0,
25+
'consistent-return': 0,
1826
'@typescript-eslint/no-explicit-any': 0,
19-
'@typescript-eslint/no-inferrable-types': 0,
20-
'@typescript-eslint/ban-ts-ignore': 'off',
21-
'@typescript-eslint/no-var-requires': 'off',
22-
'@typescript-eslint/explicit-function-return-type': 'off',
23-
'@typescript-eslint/no-empty-function': 'off',
24-
'@typescript-eslint/no-non-null-assertion': 'off',
25-
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
26-
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
27-
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
27+
'@typescript-eslint/no-empty-function': 0,
28+
'@typescript-eslint/no-non-null-assertion': 0,
29+
'@typescript-eslint/explicit-module-boundary-types': 0,
2830
},
2931
};

.prettierignore

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
1+
.editorconfig
2+
.eslintignore
13
**/*.svg
24
package.json
3-
lib/
4-
es/
5-
dist/
6-
_site/
7-
coverage/
8-
CNAME
95
LICENSE
106
yarn.lock
11-
netlify.toml
12-
yarn-error.log
7+
**/assets
8+
**/*.yml
139
*.sh
1410
*.snap
1511
.gitignore
1612
.npmignore
1713
.prettierignore
1814
.DS_Store
19-
.editorconfig
20-
.eslintignore
21-
**/*.yml
22-
.gitattributes
23-
.stylelintrc
24-
.vcmrc
15+
node_modules/**
16+
lib/
17+
es/

.prettierrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"singleQuote": true,
33
"trailingComma": "all",
4-
"endOfLine" : "lf",
4+
"endOfLine": "lf",
55
"printWidth": 100,
66
"proseWrap": "never",
77
"arrowParens": "avoid",
@@ -14,4 +14,4 @@
1414
}
1515
}
1616
]
17-
}
17+
}

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ npm i @ant-design-vue/pro-layout@next -S
2222
First, you should add the icons that you need into the library.
2323

2424
```js
25-
import 'ant-design-vue/dist/antd.less';
25+
import 'ant-design-vue/dist/antd.less'; // antd css
26+
import '@ant-design-vue/pro-layout/dist/style.css'; // pro-layout css
27+
2628
import { createApp } from 'vue';
2729
import ProLayout, { PageContainer } from '@ant-design-vue/pro-layout';
2830

@@ -35,19 +37,27 @@ After that, you can use pro-layout in your Vue components as simply as this:
3537

3638
```vue
3739
<template>
38-
<pro-layout v-bind="state">
40+
<pro-layout
41+
:locale="locale"
42+
v-bind="state"
43+
v-model:openKeys="state.openKeys"
44+
v-model:collapsed="state.collapsed"
45+
v-model:selectedKeys="state.selectedKeys"
46+
>
3947
<router-view />
4048
</pro-layout>
4149
</template>
4250
4351
<script>
4452
import { defineComponent, reactive } from 'vue';
53+
// import { getMenuData, clearMenuItem } from '@ant-design-vue/pro-layout';
54+
55+
const locale=(i18n: string) => i18n;
4556
4657
export default defineComponent({
4758
setup() {
4859
const state = reactive({
4960
collapsed: false,
50-
5161
openKeys: ['/dashboard'],
5262
selectedKeys: ['/welcome'],
5363
@@ -63,6 +73,7 @@ export default defineComponent({
6373
});
6474
6575
return {
76+
locale,
6677
state,
6778
};
6879
},
@@ -76,6 +87,7 @@ or `TSX`
7687
import { defineComponent, reactive } from 'vue';
7788
import { RouterView } from 'vue-router';
7889
import ProLayout from '@ant-design-vue/pro-layout';
90+
import '@ant-design-vue/pro-layout/dist/style.css'; // pro-layout css
7991

8092
export default defineComponent({
8193
setup() {
@@ -108,6 +120,6 @@ export default defineComponent({
108120
## Build project
109121

110122
```bash
111-
npm run compile # Build library
123+
npm run build # Build library
112124
npm run test # Runing Test
113125
```

babel.config.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

examples/App.vue

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<template>
2+
<a-config-provider :getPopupContainer="getPopupContainer">
3+
<router-view />
4+
</a-config-provider>
5+
</template>
6+
7+
<script lang="ts">
8+
import { defineComponent } from 'vue';
9+
10+
export default defineComponent({
11+
name: 'App',
12+
setup() {
13+
const getPopupContainer = (el: Element, dialogContext: any) => {
14+
if (dialogContext) {
15+
return dialogContext.getDialogWrap();
16+
} else {
17+
return document.body;
18+
}
19+
}
20+
return {
21+
getPopupContainer,
22+
}
23+
}
24+
});
25+
</script>
26+
27+
<style>
28+
#app {
29+
height: 100%;
30+
}
31+
</style>

examples/_util/icons.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

examples/base-menu.html

Whitespace-only changes.

examples/base-menu.tsx

Lines changed: 0 additions & 107 deletions
This file was deleted.

examples/demo.less

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)