Skip to content

Commit b155627

Browse files
committed
style: format code
1 parent a13dd20 commit b155627

File tree

19 files changed

+48
-44
lines changed

19 files changed

+48
-44
lines changed

.eslintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,14 @@
5050
"camelcase": "off",
5151
"no-extra-boolean-cast": "off",
5252
"semi": ["error", "always"],
53+
"vue/require-explicit-emits": "off",
5354
"vue/require-prop-types": "off",
5455
"vue/require-default-prop": "off",
5556
"vue/no-reserved-keys": "off",
5657
"vue/comment-directive": "off",
5758
"vue/prop-name-casing": "off",
59+
"vue/one-component-per-file": "off",
60+
"vue/custom-event-name-casing": "off",
5861
"vue/max-attributes-per-line": [
5962
2,
6063
{

antdv-demo

components/auto-complete/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const AutoCompleteProps = {
2525
const AutoComplete = defineComponent({
2626
name: 'AAutoComplete',
2727
inheritAttrs: false,
28-
emits: ['change', 'select', 'focus', 'blur'],
2928
props: {
3029
...AutoCompleteProps,
3130
prefixCls: PropTypes.string.def('ant-select'),
@@ -38,6 +37,7 @@ const AutoComplete = defineComponent({
3837
filterOption: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func]).def(false),
3938
defaultActiveFirstOption: PropTypes.looseBool.def(true),
4039
},
40+
emits: ['change', 'select', 'focus', 'blur'],
4141
Option: { ...Option, name: 'AAutoCompleteOption' },
4242
OptGroup: { ...OptGroup, name: 'AAutoCompleteOptGroup' },
4343
setup(props, { slots }) {

components/back-top/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ const BackTop = defineComponent({
2020
name: 'ABackTop',
2121
mixins: [BaseMixin],
2222
inheritAttrs: false,
23-
emits: ['click'],
2423
props: {
2524
...props,
2625
visibilityHeight: PropTypes.number.def(400),
2726
},
27+
emits: ['click'],
2828
setup() {
2929
return {
3030
configProvider: inject('configProvider', defaultConfigProvider),

components/color-picker/ColorPicker.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable */
12
import PropTypes from '../_util/vue-types';
23
import { defaultConfigProvider } from '../config-provider';
34
import BaseMixin from '../_util/BaseMixin';
@@ -12,6 +13,9 @@ let colors = '#194d33';
1213
export default {
1314
name: 'AColorPicker',
1415
mixins: [BaseMixin],
16+
inject: {
17+
configProvider: { default: () => defaultConfigProvider },
18+
},
1519
model: {
1620
prop: 'value',
1721
event: 'change.value', //为了支持v-model直接返回颜色字符串 所以用了自定义的事件,与pickr自带change事件进行区分
@@ -30,9 +34,7 @@ export default {
3034
alpha: PropTypes.looseBool.def(false), //是否开启透明通道
3135
hue: PropTypes.looseBool.def(true), //是否开启色彩预选
3236
},
33-
inject: {
34-
configProvider: { default: () => defaultConfigProvider },
35-
},
37+
3638
data() {
3739
return {
3840
colors,
@@ -82,7 +84,7 @@ export default {
8284
this.createPickr();
8385
this.eventsBinding();
8486
},
85-
destroyed() {
87+
unmounted() {
8688
this.pickr.destroyAndRemove();
8789
},
8890
methods: {

components/date-picker/createPicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ export default function createPicker<P>(
3232
): DefineComponent<any> {
3333
return defineComponent({
3434
name,
35+
mixins: [BaseMixin],
3536
inheritAttrs: false,
3637
props: {
3738
...props,
3839
allowClear: PropTypes.looseBool.def(true),
3940
showToday: PropTypes.looseBool.def(true),
4041
},
41-
mixins: [BaseMixin],
4242
setup() {
4343
return {
4444
configProvider: inject('configProvider', defaultConfigProvider),

components/drawer/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const PlacementTypes = tuple('top', 'right', 'bottom', 'left');
1313
type placementType = typeof PlacementTypes[number];
1414
const Drawer = defineComponent({
1515
name: 'ADrawer',
16+
mixins: [BaseMixin],
1617
inheritAttrs: false,
1718
props: {
1819
closable: PropTypes.looseBool.def(true),
@@ -40,7 +41,6 @@ const Drawer = defineComponent({
4041
onClose: PropTypes.func,
4142
'onUpdate:visible': PropTypes.func,
4243
},
43-
mixins: [BaseMixin],
4444
setup(props) {
4545
const configProvider = inject('configProvider', defaultConfigProvider);
4646
return {

components/modal/Modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ export const destroyFns = [];
150150
export default defineComponent({
151151
name: 'AModal',
152152
inheritAttrs: false,
153-
emits: ['update:visible', 'cancel', 'change', 'ok'],
154153
props: initDefaultProps(modalProps, {
155154
width: 520,
156155
transitionName: 'zoom',
@@ -159,6 +158,7 @@ export default defineComponent({
159158
visible: false,
160159
okType: 'primary',
161160
}),
161+
emits: ['update:visible', 'cancel', 'change', 'ok'],
162162
setup() {
163163
return {
164164
configProvider: inject('configProvider', defaultConfigProvider),

components/popconfirm/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const btnProps = buttonTypes();
1818

1919
const Popconfirm = defineComponent({
2020
name: 'APopconfirm',
21+
mixins: [BaseMixin],
2122
props: {
2223
...tooltipProps,
2324
prefixCls: PropTypes.string,
@@ -36,7 +37,6 @@ const Popconfirm = defineComponent({
3637
onCancel: PropTypes.func,
3738
onVisibleChange: PropTypes.func,
3839
},
39-
mixins: [BaseMixin],
4040
emits: ['update:visible', 'confirm', 'cancel', 'visibleChange'],
4141
setup() {
4242
return {

components/slider/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ const Slider = defineComponent({
5555
name: 'ASlider',
5656
mixins: [BaseMixin],
5757
inheritAttrs: false,
58+
props: {
59+
...SliderProps(),
60+
},
5861
emits: ['update:value', 'change'],
5962
setup() {
6063
return {
6164
vcSlider: null,
6265
configProvider: inject('configProvider', defaultConfigProvider),
6366
};
6467
},
65-
props: {
66-
...SliderProps(),
67-
},
6868
data() {
6969
return {
7070
visibles: {},

0 commit comments

Comments
 (0)