chore: add trailingComma

This commit is contained in:
陈嘉涵
2020-01-19 11:57:09 +08:00
parent e841175fe8
commit 389d68884d
269 changed files with 2706 additions and 2702 deletions
+1 -1
View File
@@ -28,6 +28,6 @@ export function BindEventMixin(handler: BindEventHandler) {
mounted: bind,
activated: bind,
deactivated: unbind,
beforeDestroy: unbind
beforeDestroy: unbind,
};
}
+10 -10
View File
@@ -18,12 +18,12 @@ export const CheckboxMixin = ({ parent, bem, role }) => ({
labelDisabled: Boolean,
shape: {
type: String,
default: 'round'
default: 'round',
},
bindGroup: {
type: Boolean,
default: true
}
default: true,
},
},
computed: {
@@ -42,7 +42,7 @@ export const CheckboxMixin = ({ parent, bem, role }) => ({
if (checkedColor && this.checked && !this.isDisabled) {
return {
borderColor: checkedColor,
backgroundColor: checkedColor
backgroundColor: checkedColor,
};
}
},
@@ -53,7 +53,7 @@ export const CheckboxMixin = ({ parent, bem, role }) => ({
}
return 0;
}
},
},
methods: {
@@ -78,7 +78,7 @@ export const CheckboxMixin = ({ parent, bem, role }) => ({
ref="icon"
class={bem('icon', [
this.shape,
{ disabled: this.isDisabled, checked }
{ disabled: this.isDisabled, checked },
])}
style={{ fontSize: addUnit(iconSize) }}
>
@@ -97,14 +97,14 @@ export const CheckboxMixin = ({ parent, bem, role }) => ({
<span
class={bem('label', [
this.labelPosition,
{ disabled: this.isDisabled }
{ disabled: this.isDisabled },
])}
>
{slot}
</span>
);
}
}
},
},
render() {
@@ -121,7 +121,7 @@ export const CheckboxMixin = ({ parent, bem, role }) => ({
role={role}
class={bem({
disabled: this.isDisabled,
'label-disabled': this.labelDisabled
'label-disabled': this.labelDisabled,
})}
tabindex={this.tabindex}
aria-checked={String(this.checked)}
@@ -130,5 +130,5 @@ export const CheckboxMixin = ({ parent, bem, role }) => ({
{Children}
</div>
);
}
},
});
+3 -3
View File
@@ -14,8 +14,8 @@ export const ClickOutsideMixin = (config: ClickOutsideMixinConfig) =>
props: {
closeOnClickOutside: {
type: Boolean,
default: true
}
default: true,
},
},
data() {
@@ -34,5 +34,5 @@ export const ClickOutsideMixin = (config: ClickOutsideMixinConfig) =>
beforeDestroy() {
off(document, config.event, this.clickOutsideHandler);
}
},
});
+6 -6
View File
@@ -6,23 +6,23 @@ export const CloseOnPopstateMixin = Vue.extend({
mixins: [
BindEventMixin(function(this: any, bind, isBind) {
this.handlePopstate(isBind && this.closeOnPopstate);
})
}),
],
props: {
closeOnPopstate: Boolean
closeOnPopstate: Boolean,
},
data() {
return {
bindStatus: false
bindStatus: false,
};
},
watch: {
closeOnPopstate(val: boolean) {
this.handlePopstate(val);
}
},
},
methods: {
@@ -37,6 +37,6 @@ export const CloseOnPopstateMixin = Vue.extend({
const action = bind ? on : off;
action(window, 'popstate', (this as any).close);
}
}
}
},
},
});
+1 -1
View File
@@ -12,5 +12,5 @@ export const context = {
get top(): StackItem {
return this.stack[this.stack.length - 1];
}
},
};
+11 -11
View File
@@ -22,13 +22,13 @@ export const popupMixinProps = {
// prevent body scroll
lockScroll: {
type: Boolean,
default: true
default: true,
},
// whether to lazy render
lazyRender: {
type: Boolean,
default: true
}
default: true,
},
};
export function PopupMixin(options = {}) {
@@ -41,22 +41,22 @@ export function PopupMixin(options = {}) {
if (this.overlay) {
updateOverlay();
}
}
})
},
}),
],
props: popupMixinProps,
data() {
return {
inited: this.value
inited: this.value,
};
},
computed: {
shouldRender() {
return this.inited || !this.lazyRender;
}
},
},
watch: {
@@ -70,7 +70,7 @@ export function PopupMixin(options = {}) {
}
},
overlay: 'renderOverlay'
overlay: 'renderOverlay',
},
mounted() {
@@ -186,7 +186,7 @@ export function PopupMixin(options = {}) {
zIndex: context.zIndex++,
duration: this.duration,
className: this.overlayClass,
customStyle: this.overlayStyle
customStyle: this.overlayStyle,
});
} else {
closeOverlay(this);
@@ -196,7 +196,7 @@ export function PopupMixin(options = {}) {
updateZIndex(value = 0) {
this.$el.style.zIndex = ++context.zIndex + value;
}
}
},
},
};
}
+4 -4
View File
@@ -10,7 +10,7 @@ export type OverlayConfig = {
const defaultConfig: OverlayConfig = {
className: '',
customStyle: {}
customStyle: {},
};
let overlay: any;
@@ -34,8 +34,8 @@ function onClickOverlay(): void {
function mountOverlay() {
overlay = mount(Overlay, {
on: {
click: onClickOverlay
}
click: onClickOverlay,
},
});
}
@@ -55,7 +55,7 @@ export function updateOverlay(): void {
}
Object.assign(overlay, defaultConfig, config, {
show: true
show: true,
});
} else {
overlay.show = false;
+4 -4
View File
@@ -17,11 +17,11 @@ function getElement(selector: string | GetContainer): Element | null {
export function PortalMixin({ ref, afterPortal }: PortalMixinOptions) {
return Vue.extend({
props: {
getContainer: [String, Function] as (PropType<string | GetContainer>)
getContainer: [String, Function] as (PropType<string | GetContainer>),
},
watch: {
getContainer: 'portal'
getContainer: 'portal',
},
mounted() {
@@ -49,7 +49,7 @@ export function PortalMixin({ ref, afterPortal }: PortalMixinOptions) {
if (afterPortal) {
afterPortal.call(this);
}
}
}
},
},
});
}
+8 -8
View File
@@ -31,8 +31,8 @@ export function ChildrenMixin(parent: string, options: ChildrenMixinOptions = {}
return Vue.extend({
inject: {
[parent]: {
default: null
}
default: null,
},
},
computed: {
@@ -47,7 +47,7 @@ export function ChildrenMixin(parent: string, options: ChildrenMixinOptions = {}
[indexKey]() {
this.bindRelation();
return this.parent.children.indexOf(this);
}
},
},
mounted() {
@@ -71,8 +71,8 @@ export function ChildrenMixin(parent: string, options: ChildrenMixinOptions = {}
children.sort((a, b) => vnodes.indexOf(a.$vnode) - vnodes.indexOf(b.$vnode));
this.parent.children = children;
}
}
},
},
});
}
@@ -80,14 +80,14 @@ export function ParentMixin(parent: string) {
return {
provide() {
return {
[parent]: this
[parent]: this,
};
},
data() {
return {
children: []
children: [],
};
}
},
};
}
+2 -2
View File
@@ -15,6 +15,6 @@ export const SlotsMixin = Vue.extend({
}
return $slots[name];
}
}
},
},
});
+2 -2
View File
@@ -66,6 +66,6 @@ export const TouchMixin = Vue.extend({
on(el, 'touchend', onTouchEnd);
on(el, 'touchcancel', onTouchEnd);
}
}
}
},
},
});