(component): 临时解决 date-picker 类型警告

This commit is contained in:
就眠儀式 2022-10-18 00:10:35 +08:00
parent 1c804c6db9
commit e732e8ed17
9 changed files with 20 additions and 27 deletions

View File

@ -10,7 +10,7 @@ import { computed, inject, useSlots } from "vue";
import "./index.less";
import { CheckboxSize } from "./interface";
export interface LayCheckboxProps {
export interface CheckboxProps {
name?: string;
skin?: string;
value: string | number | object;
@ -21,7 +21,7 @@ export interface LayCheckboxProps {
size?: CheckboxSize;
}
const props = withDefaults(defineProps<LayCheckboxProps>(), {
const props = withDefaults(defineProps<CheckboxProps>(), {
isIndeterminate: false,
modelValue: false,
disabled: false,

View File

@ -8,12 +8,12 @@ export default {
import { provide, ref, watch } from "vue";
import { Recordable } from "../../types";
export interface LayCheckboxGroupProps {
export interface CheckboxGroupProps {
modelValue?: Recordable[];
disabled?: boolean;
}
const props = withDefaults(defineProps<LayCheckboxGroupProps>(), {
const props = withDefaults(defineProps<CheckboxGroupProps>(), {
modelValue: () => [],
disabled: false,
});
@ -22,6 +22,7 @@ const emit = defineEmits(["update:modelValue", "change"]);
const modelValue = ref(props.modelValue);
const disabled = ref(props.disabled);
provide("checkboxGroup", {
name: "LayCheckboxGroup",
modelValue: modelValue,

View File

@ -7,7 +7,7 @@ export default {
<script setup lang="ts">
import { computed } from "vue";
export interface LayColProps {
export interface ColProps {
md?: string | number;
xs?: string | number;
sm?: string | number;
@ -18,7 +18,7 @@ export interface LayColProps {
lgOffset?: string | number;
}
const props = defineProps<LayColProps>();
const props = defineProps<ColProps>();
const classes = computed(() => {
return [

View File

@ -11,7 +11,7 @@ import EyeDropper from "./EyeDropper.vue";
import { ref, computed, watch, onMounted } from "vue";
import { useEyeDropper } from "@vueuse/core";
export interface LayColorPicker {
export interface ColorPicker {
modelValue?: any;
preset?: any;
eyeDropper?: boolean;
@ -19,7 +19,7 @@ export interface LayColorPicker {
const emit = defineEmits(["update:modelValue"]);
const props = withDefaults(defineProps<LayColorPicker>(), {
const props = withDefaults(defineProps<ColorPicker>(), {
modelValue: { r: 255, g: 255, b: 255, a: 1 },
preset: ["#009688", "#1e9fff", "#ffb800", "#ff5722", "#5fb878"],
});
@ -84,7 +84,6 @@ watch(alpha, () => {
"update:modelValue",
rgba2hex(red.value, green.value, blue.value, alpha.value)
);
//
alphaSliderStyle.value = `left: ${
alpha.value >= 1 ? "calc(100% - 6px)" : alpha.value * 100 + "%"
};`;
@ -108,7 +107,6 @@ let colorObj = computed(() => {
};
});
// ,
function hexChange(e: any) {
let v = e.target.value;
if (/^#?([0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(v)) {
@ -158,7 +156,6 @@ function alphaChange(e: any) {
}
}
//
function presetChange(item: any) {
if (/^#?([0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(item)) {
let { r, g, b, a } = hex2rgba(item);
@ -169,7 +166,6 @@ function presetChange(item: any) {
}
}
//
function handleChangeSV(e: any) {
// @ts-ignore
let w = saturationValue.value.clientWidth;
@ -260,10 +256,6 @@ function mouseupAlpha(e: any) {
window.removeEventListener("mouseup", mouseupAlpha);
}
/**
* 解析输入的数据,只能解析hex颜色和rgb对象形式的数据
* @param color
*/
function parseColor(color: any) {
if (color) {
let r, g, b, a;

View File

@ -9,11 +9,11 @@ import "./index.less";
import { computed } from "vue";
import { BooleanOrString } from "../../types";
export interface LayContainerProps {
export interface ContainerProps {
fluid?: BooleanOrString;
}
const props = withDefaults(defineProps<LayContainerProps>(), {
const props = withDefaults(defineProps<ContainerProps>(), {
fluid: false,
});

View File

@ -8,7 +8,7 @@ export default {
import { computed, onMounted, Ref, ref, watch } from "vue";
import { TransitionPresets, useTransition } from "@vueuse/core";
export interface LayCountupProps {
export interface CountUpProps {
startVal?: number; //
endVal?: number; //
decimal?: string; //
@ -23,7 +23,7 @@ export interface LayCountupProps {
suffix?: string; //
}
const props = withDefaults(defineProps<LayCountupProps>(), {
const props = withDefaults(defineProps<CountUpProps>(), {
startVal: 0,
endVal: 0,
decimal: ".",

View File

@ -117,7 +117,7 @@ import MonthPanel from "./components/MonthPanel.vue";
import DateRange from "./components/DateRange.vue";
import MonthRange from "./components/MonthRange.vue";
export interface LayDatePickerProps {
export interface DatePickerProps {
type?: "date" | "datetime" | "year" | "time" | "month" | "yearmonth";
placeholder?: string;
modelValue?: string | number | string[];
@ -136,7 +136,7 @@ export interface LayDatePickerProps {
timestamp?: boolean;
}
const props = withDefaults(defineProps<LayDatePickerProps>(), {
const props = withDefaults(defineProps<DatePickerProps>(), {
modelValue: "",
type: "date",
disabled: false,

View File

@ -50,7 +50,7 @@ import { transformPlacement } from "./util";
export type DropdownTrigger = "click" | "hover" | "focus" | "contextMenu";
export interface LayDropdownProps {
export interface DropdownProps {
visible?: boolean;
trigger?: DropdownTrigger | DropdownTrigger[];
placement?: DropdownPlacement;
@ -73,7 +73,7 @@ export interface LayDropdownProps {
popupContainer?: string | undefined;
}
const props = withDefaults(defineProps<LayDropdownProps>(), {
const props = withDefaults(defineProps<DropdownProps>(), {
visible: false,
trigger: "click",
disabled: false,

View File

@ -13,12 +13,12 @@ import PasswordIcon from "./svg/Password.vue";
import UnPasswordIcon from "./svg/unPassword.vue";
import { InputSize } from "./interface";
export interface LayInputProps {
export interface InputProps {
name?: string;
type?: string;
prefixIcon?: string;
suffixIcon?: string;
modelValue?: string | number;
modelValue?: string | number | string[] | undefined;
allowClear?: boolean;
autocomplete?: string;
placeholder?: string;
@ -30,7 +30,7 @@ export interface LayInputProps {
maxlength?: number;
}
const props = withDefaults(defineProps<LayInputProps>(), {
const props = withDefaults(defineProps<InputProps>(), {
disabled: false,
readonly: false,
allowClear: false,