!37 format code

* chore: format code
This commit is contained in:
Sagi 2022-10-01 15:39:20 +00:00
parent bc94cefa71
commit 7e801baa5b
16 changed files with 50 additions and 52 deletions

View File

@ -11,7 +11,7 @@ export default defineComponent({
setup(props: AccordingProps, context: SetupContext) {
const accordingStyle = computed(() => ({
height: props.height ? `${props.height}px` : '',
width: props.width ? `${props.width}px` : '',
width: props.width ? `${props.width}px` : ''
}));
return () => {
@ -21,5 +21,5 @@ export default defineComponent({
</div>
);
};
},
}
});

View File

@ -1,4 +1,4 @@
/* 很重要 */
.farris-panel {
border: 1px solid rgba(0, 0, 0, .125)
border: 1px solid rgba(0, 0, 0, 0.125);
}

View File

@ -5,6 +5,6 @@ export const accordingProps = {
height: { type: Number },
width: { type: Number },
enableFold: { type: Boolean, default: true },
expanded: { type: Boolean, default: false },
expanded: { type: Boolean, default: false }
};
export type AccordingProps = ExtractPropTypes<typeof accordingProps>;

View File

@ -19,7 +19,7 @@ export default defineComponent({
'f-state-disable': isDisabled.value,
card: true,
'farris-panel-item': true,
'f-state-selected': isActive.value,
'f-state-selected': isActive.value
}));
const shouldShowHeader = computed(() => {
@ -33,7 +33,7 @@ export default defineComponent({
const headIconClass = computed(() => ({
'f-icon': true,
'f-according-collapse': !isActive.value,
'f-according-expand': isActive.value,
'f-according-expand': isActive.value
}));
return () => {
@ -54,5 +54,5 @@ export default defineComponent({
</div>
);
};
},
}
});

View File

@ -1,10 +1,9 @@
import { ExtractPropTypes } from 'vue';
export const accordingItemProps = {
width:{type:Number},
height:{type:Number},
title:{type:String,default:''},
disable:{type:Boolean,default:false}
width: { type: Number },
height: { type: Number },
title: { type: String, default: '' },
disable: { type: Boolean, default: false }
};
export type AccordingItemProps = ExtractPropTypes<typeof accordingItemProps>;

View File

@ -34,9 +34,9 @@ export default defineComponent({
function getfiledata() {}
const file=ref(null);
const file = ref(null);
const { acceptTypes, imageSource,onClickImage } = useImage(props, context, file, modelValue);
const { acceptTypes, imageSource, onClickImage } = useImage(props, context, file, modelValue);
return () => {
return (
@ -46,7 +46,7 @@ export default defineComponent({
<div class="loading-inner"></div>
</div>
)}
<img title={props.tile} class="f-avatar-image" src={imageSource.value} onError={errorSrc()} />
<img title={props.tile} class="f-avatar-image" src={imageSource.value} onError={errorSrc()} />
{!props.readonly && (
<div class="f-avatar-icon">
<span class="f-icon f-icon-camera"></span>

View File

@ -1,25 +1,26 @@
.f-avatar{
.f-avatar {
position: relative;
// width: 100%;
// height: 100%;
cursor: pointer;
overflow: hidden;
&.f-avatar-readonly{
&.f-avatar-readonly {
cursor: default;
}
&.f-avatar-circle{
&.f-avatar-circle {
border-radius: 100%;
overflow: hidden;
}
&.f-avatar-square{
&.f-avatar-square {
border-radius: 0;
}
.f-avatar-image,.f-avatar-defult{
.f-avatar-image,
.f-avatar-defult {
display: inline-block;
width: 100%;
height: 100%;
}
.f-avatar-icon{
.f-avatar-icon {
display: none;
position: absolute;
left: 0;
@ -29,26 +30,26 @@
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.3);
.f-icon{
.f-icon {
font-size: 24px;
color: #fff;
}
}
&.f-avatar-circle .f-avatar-icon{
&.f-avatar-circle .f-avatar-icon {
border-radius: 100%;
}
&.f-avatar-square .f-avatar-icon{
&.f-avatar-square .f-avatar-icon {
border-radius: 0;
}
.f-avatar-upload-loading{
.f-avatar-upload-loading {
position: absolute;
left: 0;
top: 0;
display: inline-block;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.15);
.loading-inner{
background-color: rgba(0, 0, 0, 0.15);
.loading-inner {
position: absolute;
width: 100%;
left: 0;
@ -61,9 +62,9 @@
color: #fff;
}
}
&:hover{
.f-avatar-icon{
&:hover {
.f-avatar-icon {
display: flex;
}
}
}
}

View File

@ -5,7 +5,6 @@ import { AvatarProps } from '../avatar.props';
import { ImageFile } from './types';
export function useFile(props: AvatarProps, context: SetupContext, allowTypes: string[]) {
function getFileData($event: Event) {
if (props.readonly) {
return;
@ -90,5 +89,4 @@ export function useFile(props: AvatarProps, context: SetupContext, allowTypes: s
});
});
}
}

View File

@ -3,7 +3,7 @@ import { NotifyData, ToastyAnimate } from '../notify.props';
export const toastProps = {
animate: { type: String as PropType<ToastyAnimate>, default: 'fadeIn' },
options: { type: Object as PropType<NotifyData> },
options: { type: Object as PropType<NotifyData> }
};
export type ToastProps = ExtractPropTypes<typeof toastProps>;

View File

@ -10,7 +10,7 @@ export default defineComponent({
const popoverContainerClass = computed(() => ({
'popover-content': true,
'popover-body': true,
'popover-body': true
}));
return () => {
@ -22,5 +22,5 @@ export default defineComponent({
</>
);
};
},
}
});

View File

@ -4,7 +4,7 @@ export type PopoverPosition = 'top' | 'bottom' | 'left' | 'right' | 'auto';
export const popoverProps = {
title: { type: String },
position: { type: String as PropType<PopoverPosition>, default: 'top' },
position: { type: String as PropType<PopoverPosition>, default: 'top' }
};
export type PopoverProps = ExtractPropTypes<typeof popoverProps>;

View File

@ -33,11 +33,11 @@ export default defineComponent({
'farris-tabs-inHead': hasInHeadClass.value,
'farris-tabs-inContent': !hasInHeadClass.value,
'farris-tabs-nav-fill': shouldShowNavFill.value,
'farris-tabs-nav-pills': shouldShowNavPills.value,
'farris-tabs-nav-pills': shouldShowNavPills.value
}));
const tabsTitleStyle = computed(() => ({
width: hasInHeadClass.value ? (props.titleWidth ? `${props.titleWidth}%` : '') : '',
width: hasInHeadClass.value ? (props.titleWidth ? `${props.titleWidth}%` : '') : ''
}));
const tabsTitleButtonClass = computed(() => ({
@ -45,14 +45,14 @@ export default defineComponent({
'sc-nav-btn': true,
'px-1': true,
'sc-nav-lr': true,
'd-none': hideButtons.value,
'd-none': hideButtons.value
}));
const tabParentClass = computed(() => ({
spacer: true,
'f-utils-fill': true,
'spacer-sides': !hideButtons.value && hideDropDown.value,
'spacer-sides-dropdown': !hideButtons.value && !hideDropDown.value,
'spacer-sides-dropdown': !hideButtons.value && !hideDropDown.value
}));
const tabContainerClass = computed(() => ({
@ -62,7 +62,7 @@ export default defineComponent({
'nav-fill': fill.value || tabType.value === 'fill',
'nav-pills': tabType.value === 'pills',
'flex-row': position.value === 'top' || position.value === 'bottom',
'flex-column': position.value === 'left' || position.value === 'right',
'flex-column': position.value === 'left' || position.value === 'right'
}));
function getTabClass(tab: any) {
@ -70,7 +70,7 @@ export default defineComponent({
'nav-item': true,
'd-none': !tab.show,
'f-state-active': tab.id === activeId,
'f-state-disable': tab.disabled,
'f-state-disable': tab.disabled
};
}
@ -83,7 +83,7 @@ export default defineComponent({
'nav-link': true,
'tabs-text-truncate': true,
active: tab.id === activeId,
disabled: tab.disabled,
disabled: tab.disabled
};
}
@ -93,7 +93,7 @@ export default defineComponent({
return {
'st-tab-text': true,
'farris-title-auto': props.autoTitleWidth,
'farris-title-text-custom': tab.titleOverflow,
'farris-title-text-custom': tab.titleOverflow
};
}
@ -127,5 +127,5 @@ export default defineComponent({
</>
);
};
},
}
});

View File

@ -18,7 +18,7 @@ export const tabsProps = {
height: { type: Number },
searchBoxVisible: { type: Boolean, default: true },
titleWidth: { type: Number, default: 0 },
customClass: { type: String, default: '' },
customClass: { type: String, default: '' }
};
export type TabsProps = ExtractPropTypes<typeof tabsProps>;

View File

@ -15,14 +15,14 @@ export default defineComponent({
const textClass = computed(() => ({
'f-form-control-text': !isTextArea.value,
'f-form-context-textarea': isTextArea,
'f-component-text-auto-size': autoSize.value,
'f-component-text-auto-size': autoSize.value
}));
const textStyle = computed(() => ({
textalign: textAlginment.value,
height: !autoSize.value && height.value > 0 ? `${height.value}px` : '',
'min-height': !autoSize.value && height.value > 0 ? `${height.value}px` : '',
'max-height': !autoSize.value && maxHeight.value > 0 ? `${maxHeight.value}px` : '',
'max-height': !autoSize.value && maxHeight.value > 0 ? `${maxHeight.value}px` : ''
}));
const text = computed(() => {
@ -37,5 +37,5 @@ export default defineComponent({
</span>
);
};
},
}
});

View File

@ -12,7 +12,7 @@ export default defineComponent({
const tooltipClass = computed(() => ({
tooltip: true,
show: true,
show: true
}));
const shouldShowTooltipText = computed(() => isTextContext.value);
@ -31,5 +31,5 @@ export default defineComponent({
</div>
);
};
},
}
});

View File

@ -18,6 +18,6 @@ export const tooltipProps = {
content: { type: String },
width: { type: Number },
customClass: { type: String },
position: { type: String as PropType<TooltipPosition>, default: 'top' },
position: { type: String as PropType<TooltipPosition>, default: 'top' }
};
export type TooltipProps = ExtractPropTypes<typeof tooltipProps>;