From 7cbba0ac54b593e85c7d6135e8f1cecd1a80e79e Mon Sep 17 00:00:00 2001
From: tanjinzhou <415800467@qq.com>
Date: Mon, 30 Dec 2019 15:06:48 +0800
Subject: [PATCH] style: format code
---
.prettierignore | 4 +--
components/_util/responsiveObserve.js | 8 ++---
.../descriptions/__tests__/demo.test.js | 2 +-
components/page-header/demo/actions.md | 2 +-
components/page-header/index.en-US.md | 6 ++--
components/page-header/index.jsx | 29 ++++++++++---------
components/page-header/index.zh-CN.md | 6 ++--
components/result/__tests__/index.test.js | 21 ++++++++------
components/result/demo/403.md | 2 +-
components/result/demo/404.md | 2 +-
components/result/demo/500.md | 2 +-
components/result/demo/error.md | 2 +-
components/result/demo/success.md | 2 +-
components/result/index.en-US.md | 14 ++++-----
components/result/index.jsx | 11 +++----
components/result/index.zh-CN.md | 14 ++++-----
components/result/noFound.jsx | 7 +++--
components/table/demo/resizable-column.vue | 2 +-
site/demo.js | 4 +--
types/ant-design-vue.d.ts | 2 +-
types/descriptions/descriptions.d.ts | 2 +-
types/page-header.d.ts | 1 -
types/result.d.ts | 1 -
23 files changed, 73 insertions(+), 73 deletions(-)
diff --git a/.prettierignore b/.prettierignore
index f03c4e5e0..6a0eec280 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -24,6 +24,6 @@ components/style/color/*.less
.gitattributes
.stylelintrc
.vcmrc
-.logo
+.png
.npmrc.template
-.huskyrc
\ No newline at end of file
+.huskyrc
diff --git a/components/_util/responsiveObserve.js b/components/_util/responsiveObserve.js
index c5d2f8796..88a29c774 100644
--- a/components/_util/responsiveObserve.js
+++ b/components/_util/responsiveObserve.js
@@ -4,7 +4,7 @@ let enquire;
// TODO: Will be removed in antd 4.0 because we will no longer support ie9
if (typeof window !== 'undefined') {
- const matchMediaPolyfill = (mediaQuery) => {
+ const matchMediaPolyfill = mediaQuery => {
return {
media: mediaQuery,
matches: false,
@@ -65,12 +65,10 @@ const responsiveObserve = {
}
},
unregister() {
- Object.keys(responsiveMap).map((screen) =>
- enquire.unregister(responsiveMap[screen]),
- );
+ Object.keys(responsiveMap).map(screen => enquire.unregister(responsiveMap[screen]));
},
register() {
- Object.keys(responsiveMap).map((screen) =>
+ Object.keys(responsiveMap).map(screen =>
enquire.register(responsiveMap[screen], {
match: () => {
const pointMap = {
diff --git a/components/descriptions/__tests__/demo.test.js b/components/descriptions/__tests__/demo.test.js
index 7d16a4ab6..966d453be 100644
--- a/components/descriptions/__tests__/demo.test.js
+++ b/components/descriptions/__tests__/demo.test.js
@@ -1,3 +1,3 @@
import demoTest from '../../../tests/shared/demoTest';
-demoTest('descriptions');
\ No newline at end of file
+demoTest('descriptions');
diff --git a/components/page-header/demo/actions.md b/components/page-header/demo/actions.md
index 9f6c8a7d6..e71b6cf05 100644
--- a/components/page-header/demo/actions.md
+++ b/components/page-header/demo/actions.md
@@ -71,4 +71,4 @@ tr:last-child td {
padding-bottom: 0;
}
-```
\ No newline at end of file
+```
diff --git a/components/page-header/index.en-US.md b/components/page-header/index.en-US.md
index 750348b01..2c643cb28 100644
--- a/components/page-header/index.en-US.md
+++ b/components/page-header/index.en-US.md
@@ -13,6 +13,6 @@
### Events
-| Events Name | Description | Arguments |
-| ------------- | -------------------------------------- | ----------------- |
-| back | back icon click event | function(e) |
+| Events Name | Description | Arguments |
+| ----------- | --------------------- | ----------- |
+| back | back icon click event | function(e) |
diff --git a/components/page-header/index.jsx b/components/page-header/index.jsx
index c1b12a754..58c55dbf4 100644
--- a/components/page-header/index.jsx
+++ b/components/page-header/index.jsx
@@ -45,13 +45,11 @@ const renderBack = (instance, prefixCls, backIcon, onBack) => {
};
const renderBreadcrumb = (h, breadcrumb) => {
- return ;
+ return ;
};
const renderTitle = (h, prefixCls, instance) => {
- const {
- avatar,
- } = instance;
+ const { avatar } = instance;
const title = getComponentFromProp(instance, 'title');
const subTitle = getComponentFromProp(instance, 'subTitle');
const tags = getComponentFromProp(instance, 'tags');
@@ -64,7 +62,7 @@ const renderTitle = (h, prefixCls, instance) => {
return (
{backIconDom}
- {avatar &&
}
+ {avatar &&
}
{title &&
{title}}
{subTitle &&
{subTitle}}
{tags &&
{tags}}
@@ -94,19 +92,22 @@ const PageHeader = {
},
render(h) {
const { getPrefixCls } = this.configProvider;
- const {
- prefixCls: customizePrefixCls,
- breadcrumb,
- } = this.$props;
+ const { prefixCls: customizePrefixCls, breadcrumb } = this.$props;
const footer = getComponentFromProp(this, 'footer');
const children = this.$slots.default;
const prefixCls = getPrefixCls('page-header', customizePrefixCls);
- const breadcrumbDom = breadcrumb && breadcrumb.props && breadcrumb.props.routes ? renderBreadcrumb(h, breadcrumb) : null;
- const className = [prefixCls, {
- 'has-breadcrumb': breadcrumbDom,
- 'has-footer': footer,
- }];
+ const breadcrumbDom =
+ breadcrumb && breadcrumb.props && breadcrumb.props.routes
+ ? renderBreadcrumb(h, breadcrumb)
+ : null;
+ const className = [
+ prefixCls,
+ {
+ 'has-breadcrumb': breadcrumbDom,
+ 'has-footer': footer,
+ },
+ ];
return (
diff --git a/components/page-header/index.zh-CN.md b/components/page-header/index.zh-CN.md
index c3b2a4b35..6f7b08866 100644
--- a/components/page-header/index.zh-CN.md
+++ b/components/page-header/index.zh-CN.md
@@ -13,6 +13,6 @@
### 事件
-| 事件名称 | 说明 | 回调参数 |
-| ------------- | -------------------------------------- | ----------------- |
-| back | 返回按钮的点击事件 | function(e) |
+| 事件名称 | 说明 | 回调参数 |
+| -------- | ------------------ | ----------- |
+| back | 返回按钮的点击事件 | function(e) |
diff --git a/components/result/__tests__/index.test.js b/components/result/__tests__/index.test.js
index fff8d2530..50e085684 100644
--- a/components/result/__tests__/index.test.js
+++ b/components/result/__tests__/index.test.js
@@ -3,16 +3,19 @@ import Result from '../index';
import Button from '../../button';
describe('Result', () => {
-
it('🙂 successPercent should decide the progress status when it exists', () => {
const wrapper = mount({
- render () {
+ render() {
return (
Go Console}
+ extra={
+
+ }
/>
);
},
@@ -39,8 +42,8 @@ describe('Result', () => {
it('🙂 When status = 404, the icon is an image', () => {
const wrapper = mount({
- render () {
- return ;
+ render() {
+ return ;
},
});
expect(wrapper.findAll('.ant-result-404 .ant-result-image')).toHaveLength(1);
@@ -48,8 +51,8 @@ describe('Result', () => {
it('🙂 When extra is undefined, the extra dom is undefined', () => {
const wrapper = mount({
- render () {
- return ;
+ render() {
+ return ;
},
});
expect(wrapper.findAll('.ant-result-extra')).toHaveLength(0);
@@ -57,8 +60,8 @@ describe('Result', () => {
it('🙂 result should support className', () => {
const wrapper = mount({
- render () {
- return ;
+ render() {
+ return ;
},
});
expect(wrapper.findAll('.ant-result.my-result')).toHaveLength(1);
diff --git a/components/result/demo/403.md b/components/result/demo/403.md
index 88d86d9f1..ab9de3688 100644
--- a/components/result/demo/403.md
+++ b/components/result/demo/403.md
@@ -10,7 +10,7 @@ you are not authorized to access this page.
```tpl
-
-
-
-
- {
}
// prop `icon` require slot or VNode
const iconString = IconMap[status];
- const iconNode = icon || ;
+ const iconNode = icon || ;
return {iconNode}
;
};
-const renderExtra = (h, prefixCls, extra) => extra && ;
+const renderExtra = (h, prefixCls, extra) =>
+ extra && ;
const Result = {
name: 'AResult',
@@ -56,11 +57,7 @@ const Result = {
configProvider: { default: () => ConfigConsumerProps },
},
render(h) {
- const {
- prefixCls: customizePrefixCls,
- status,
- ...restProps
- } = this;
+ const { prefixCls: customizePrefixCls, status, ...restProps } = this;
const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('result', customizePrefixCls);
diff --git a/components/result/index.zh-CN.md b/components/result/index.zh-CN.md
index 15d02eb28..efca7124a 100644
--- a/components/result/index.zh-CN.md
+++ b/components/result/index.zh-CN.md
@@ -1,9 +1,9 @@
## API
-| 参数 | 说明 | 类型 | 默认值 |
-| -------- | ------------------------- | ----------------------------------------------------------------- | ------ |
-| title | title 文字 | string \| VNode \| v-slot:title | - |
-| subTitle | subTitle 文字 | string \| VNode \| v-slot:subTitle | - |
-| status | 结果的状态,决定图标和颜色 | `'success' | 'error' | 'info' | 'warning'| '404' | '403' | '500'` | 'info' |
-| icon | 自定义 icon | v-slot:icon | - |
-| extra | 操作区 | v-slot:extra | - |
+| 参数 | 说明 | 类型 | 默认值 |
+| --- | --- | --- | --- |
+| title | title 文字 | string \| VNode \| v-slot:title | - |
+| subTitle | subTitle 文字 | string \| VNode \| v-slot:subTitle | - |
+| status | 结果的状态,决定图标和颜色 | `'success' | 'error' | 'info' | 'warning'| '404' | '403' | '500'` | 'info' |
+| icon | 自定义 icon | v-slot:icon | - |
+| extra | 操作区 | v-slot:extra | - |
diff --git a/components/result/noFound.jsx b/components/result/noFound.jsx
index 9f352ed89..4c7f77a8f 100644
--- a/components/result/noFound.jsx
+++ b/components/result/noFound.jsx
@@ -1,7 +1,7 @@
const NoFound = {
functional: true,
render() {
- return(
+ return (