Skip to content

Commit f84065d

Browse files
committed
bump 2.0.0-beta.8
fix: types error
1 parent b25eb67 commit f84065d

19 files changed

+107
-82
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ es/
77
lib/
88
_site/
99
dist/
10-
types/

.eslintrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919
"rules": {
2020
"no-console": "off"
2121
}
22+
},
23+
{
24+
"files": ["**/types/**/*.ts"],
25+
"extends": ["@vue/typescript/recommended"],
26+
"rules": {
27+
"@typescript-eslint/no-explicit-any": 0,
28+
"@typescript-eslint/ban-types": 0
29+
}
2230
}
2331
],
2432
"rules": {

CHANGELOG.en-US.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111
---
1212

13+
## 2.0.0-beta.8
14+
15+
- 🐞 Fix ts types error
16+
1317
## 2.0.0-beta.7
1418

1519
- 🐞 Fix the problem that Descriptions Item does not support v-for [#2793](https://github.com/vueComponent/ant-design-vue/issues/2793)

CHANGELOG.zh-CN.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111
---
1212

13+
## 2.0.0-beta.8
14+
15+
- 🐞 修复 ts 类型错误
16+
1317
## 2.0.0-beta.7
1418

1519
- 🐞 修复 Descriptions Item 不支持 v-for 问题 [#2793](https://github.com/vueComponent/ant-design-vue/issues/2793)

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ant-design-vue",
3-
"version": "2.0.0-beta.7",
3+
"version": "2.0.0-beta.8",
44
"title": "Ant Design Vue",
55
"description": "An enterprise-class UI design language and Vue-based implementation",
66
"keywords": [
@@ -41,6 +41,7 @@
4141
"pretty-quick": "pretty-quick",
4242
"dist": "node antd-tools/cli/run.js dist",
4343
"lint": "eslint -c ./.eslintrc --fix --ext .jsx,.js,.vue ./components",
44+
"lint:types": "eslint -c ./.eslintrc --fix --ext .ts ./types",
4445
"lint:site": "eslint -c ./.eslintrc --fix --ext .jsx,.js,.vue ./antdv-demo",
4546
"lint:docs": "eslint -c ./.eslintrc --fix --ext .jsx,.js,.vue,.md ./antdv-demo/docs/**/demo/**",
4647
"lint:style": "stylelint \"{site,components}/**/*.less\" --syntax less",
@@ -78,9 +79,12 @@
7879
"@commitlint/cli": "^8.0.0",
7980
"@commitlint/config-conventional": "^8.0.0",
8081
"@octokit/rest": "^16.0.0",
82+
"@typescript-eslint/eslint-plugin": "^4.1.0",
83+
"@typescript-eslint/parser": "^4.1.0",
8184
"@vue/babel-plugin-jsx": "^1.0.0-rc.2",
8285
"@vue/cli-plugin-eslint": "^4.0.0",
8386
"@vue/compiler-sfc": "^3.0.0-rc.5",
87+
"@vue/eslint-config-typescript": "^5.1.0",
8488
"@vue/server-test-utils": "1.0.0-beta.16",
8589
"@vue/test-utils": "^2.0.0-beta.2",
8690
"acorn": "^7.0.0",

tsconfig.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"compilerOptions": {
3+
"allowSyntheticDefaultImports": true,
4+
"declaration": true,
5+
"module": "esnext",
6+
"target": "esnext",
7+
"moduleResolution": "node",
8+
"jsx": "preserve",
9+
"esModuleInterop": true
10+
},
11+
"include": ["./types"],
12+
"exclude": ["node_modules", "build", "scripts", "components", "webpack", "jest"]
13+
}

types/breadcrumb/breadcrumb-item.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export declare class BreadcrumbItem extends AntdComponent {
99
* @default ''
1010
* @type string
1111
*/
12-
href?: String;
12+
href?: string;
1313
overlay?: any;
1414
};
1515
}

types/breadcrumb/breadcrumb.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import { BreadcrumbSeparator } from './breadcrumb-separator';
88
import { AntdComponent, AntdProps } from '../component';
99

1010
export interface Route {
11-
path?: String;
12-
breadcrumbName?: String;
11+
path?: string;
12+
breadcrumbName?: string;
1313
children?: Route[];
1414
}
1515

types/button/button.d.ts

Lines changed: 58 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6,71 +6,72 @@ import { ButtonGroup } from './button-group';
66
import { VNodeChild } from 'vue';
77
import { AntdComponent, AntdProps } from '../component';
88

9-
export declare class Button extends AntdComponent {
10-
static Group: typeof ButtonGroup;
9+
export interface ButtonProps extends AntdProps {
10+
/**
11+
* can be set to primary ghost dashed danger(added in 2.7) or omitted (meaning default)
12+
* @default 'default'
13+
* @type string
14+
*/
15+
type?: 'primary' | 'danger' | 'dashed' | 'ghost' | 'default';
1116

12-
$props: AntdProps & {
13-
/**
14-
* can be set to primary ghost dashed danger(added in 2.7) or omitted (meaning default)
15-
* @default 'default'
16-
* @type string
17-
*/
18-
type?: 'primary' | 'danger' | 'dashed' | 'ghost' | 'default';
17+
/**
18+
* set the original html type of button
19+
* @default 'button'
20+
* @type string
21+
*/
22+
htmlType?: 'button' | 'submit' | 'reset' | 'menu';
1923

20-
/**
21-
* set the original html type of button
22-
* @default 'button'
23-
* @type string
24-
*/
25-
htmlType?: 'button' | 'submit' | 'reset' | 'menu';
24+
/**
25+
* set the icon of button
26+
* @type string
27+
*/
28+
icon?: VNodeChild | JSX.Element;
2629

27-
/**
28-
* set the icon of button
29-
* @type string
30-
*/
31-
icon?: VNodeChild | JSX.Element;
30+
/**
31+
* can be set to circle or circle-outline or omitted
32+
* @type string
33+
*/
34+
shape?: 'circle' | 'circle-outline';
3235

33-
/**
34-
* can be set to circle or circle-outline or omitted
35-
* @type string
36-
*/
37-
shape?: 'circle' | 'circle-outline';
36+
/**
37+
* can be set to small large or omitted
38+
* @default 'default'
39+
* @type string
40+
*/
41+
size?: 'small' | 'large' | 'default';
3842

39-
/**
40-
* can be set to small large or omitted
41-
* @default 'default'
42-
* @type string
43-
*/
44-
size?: 'small' | 'large' | 'default';
43+
/**
44+
* set the loading status of button
45+
* @default false
46+
* @type boolean | { delay: number }
47+
*/
48+
loading?: boolean | { delay: number };
4549

46-
/**
47-
* set the loading status of button
48-
* @default false
49-
* @type boolean | { delay: number }
50-
*/
51-
loading?: boolean | { delay: number };
50+
/**
51+
* disabled state of button
52+
* @default false
53+
* @type boolean
54+
*/
55+
disabled?: boolean;
5256

53-
/**
54-
* disabled state of button
55-
* @default false
56-
* @type boolean
57-
*/
58-
disabled?: boolean;
57+
/**
58+
* make background transparent and invert text and border colors, added in 2.7
59+
* @default false
60+
* @type boolean
61+
*/
62+
ghost?: boolean;
5963

60-
/**
61-
* make background transparent and invert text and border colors, added in 2.7
62-
* @default false
63-
* @type boolean
64-
*/
65-
ghost?: boolean;
64+
/**
65+
* option to fit button width to its parent width
66+
* @default false
67+
* @type boolean
68+
*/
69+
block?: boolean;
6670

67-
/**
68-
* option to fit button width to its parent width
69-
* @default false
70-
* @type boolean
71-
*/
72-
block?: boolean;
71+
onClick?: (e?: Event) => void;
72+
}
7373

74-
onClick?: (e?: Event) => void;
75-
};
74+
export declare class Button extends AntdComponent {
75+
static Group: typeof ButtonGroup;
76+
$props: ButtonProps;
7677
}

types/component.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export declare class AntdComponent {
88
static install(app: App): void;
99
}
1010

11-
export interface AntdProps extends HTMLAttributes {}
11+
export type AntdProps = HTMLAttributes

0 commit comments

Comments
 (0)