✨(component): 临时解决 date-picker 类型警告
This commit is contained in:
parent
1c804c6db9
commit
e732e8ed17
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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 [
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
});
|
||||
|
||||
|
@ -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: ".",
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user