✨(component): 开放 tree-select 组件
This commit is contained in:
@@ -1 +1 @@
|
||||
export type CascaderSize = "lg" | "md" | "sm" | "xs";
|
||||
export type CascaderSize = "lg" | "md" | "sm" | "xs";
|
||||
|
||||
@@ -1 +1 @@
|
||||
export type CheckboxSize = "lg" | "md" | "sm" | "xs";
|
||||
export type CheckboxSize = "lg" | "md" | "sm" | "xs";
|
||||
|
||||
@@ -29,7 +29,7 @@ provide("checkboxGroup", {
|
||||
});
|
||||
|
||||
watch(
|
||||
() => modelValue,
|
||||
() => modelValue,
|
||||
(val) => {
|
||||
emit("change", modelValue.value);
|
||||
emit("update:modelValue", modelValue.value);
|
||||
|
||||
@@ -41,8 +41,8 @@ const props = withDefaults(defineProps<LayCountupProps>(), {
|
||||
let localStartVal: Ref<number> = ref(props.startVal);
|
||||
const isNumber = (val: string) => !isNaN(parseFloat(val));
|
||||
|
||||
/**
|
||||
* from: https://github.com/PanJiaChen/vue-countTo/blob/master/src/vue-countTo.vue
|
||||
/**
|
||||
* from: https://github.com/PanJiaChen/vue-countTo/blob/master/src/vue-countTo.vue
|
||||
* */
|
||||
const formatNumber = (num: number | string): string => {
|
||||
if (typeof num != "number") return "0";
|
||||
@@ -66,8 +66,8 @@ const printVal = useTransition(localStartVal, {
|
||||
disabled: !props.useEasing,
|
||||
transition:
|
||||
typeof props.easingFn === "string"
|
||||
// @ts-ignore
|
||||
? TransitionPresets[props.easingFn]
|
||||
? // @ts-ignore
|
||||
TransitionPresets[props.easingFn]
|
||||
: props.easingFn,
|
||||
});
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
export type InputSize = "lg" | "md" | "sm" | "xs";
|
||||
export type InputSize = "lg" | "md" | "sm" | "xs";
|
||||
|
||||
@@ -1 +1 @@
|
||||
export type InputNumberSize = "lg" | "md" | "sm" | "xs";
|
||||
export type InputNumberSize = "lg" | "md" | "sm" | "xs";
|
||||
|
||||
@@ -1 +1 @@
|
||||
export type RadioSize = "lg" | "md" | "sm" | "xs";
|
||||
export type RadioSize = "lg" | "md" | "sm" | "xs";
|
||||
|
||||
@@ -1 +1 @@
|
||||
export type SelectSize = "lg" | "md" | "sm" | "xs";
|
||||
export type SelectSize = "lg" | "md" | "sm" | "xs";
|
||||
|
||||
@@ -1 +1 @@
|
||||
export type TagInputSize = "lg" | "md" | "sm" | "xs";
|
||||
export type TagInputSize = "lg" | "md" | "sm" | "xs";
|
||||
|
||||
@@ -57,7 +57,6 @@ const props = withDefaults(defineProps<TreeProps>(), {
|
||||
onlyIconControl: false,
|
||||
disabled: false,
|
||||
showLine: true,
|
||||
selectedKey: "",
|
||||
replaceFields: () => {
|
||||
return {
|
||||
id: "id",
|
||||
|
||||
@@ -8,6 +8,7 @@ export default {
|
||||
import "./index.less";
|
||||
import { computed, ref, watch } from "vue";
|
||||
import { getNode } from "../../utils/treeUtil";
|
||||
import { TreeSelectSize } from "./interface";
|
||||
|
||||
export interface LayTreeSelect {
|
||||
data: any;
|
||||
@@ -18,7 +19,7 @@ export interface LayTreeSelect {
|
||||
allowClear?: boolean;
|
||||
collapseTagsTooltip?: boolean;
|
||||
minCollapsedNum?: number;
|
||||
size?: string;
|
||||
size?: TreeSelectSize;
|
||||
checkStrictly?: boolean;
|
||||
}
|
||||
|
||||
@@ -66,7 +67,7 @@ const checkedKeys = computed({
|
||||
});
|
||||
|
||||
watch(
|
||||
[selectedValue],
|
||||
selectedValue,
|
||||
() => {
|
||||
if (props.multiple) {
|
||||
multipleValue.value = selectedValue.value.map((value: any) => {
|
||||
|
||||
1
package/component/src/component/treeSelect/interface.ts
Normal file
1
package/component/src/component/treeSelect/interface.ts
Normal file
@@ -0,0 +1 @@
|
||||
export type TreeSelectSize = "lg" | "md" | "sm" | "xs";
|
||||
@@ -61,6 +61,7 @@ import LayDropdownSubMenu from "./component/dropdownSubMenu/index";
|
||||
import LayTab from "./component/tab/index";
|
||||
import LayTabItem from "./component/tabItem/index";
|
||||
import LayTree from "./component/tree/index";
|
||||
import LayTreeSelect from "./component/treeSelect/index";
|
||||
import LayTable from "./component/table/index";
|
||||
import LayPage from "./component/page/index";
|
||||
import LayTransfer from "./component/transfer/index";
|
||||
@@ -180,6 +181,7 @@ const components: Record<string, Plugin> = {
|
||||
LaySpace,
|
||||
LayTag,
|
||||
LayTagInput,
|
||||
LayTreeSelect
|
||||
};
|
||||
|
||||
const install = (app: App, options?: InstallOptions): void => {
|
||||
@@ -276,6 +278,7 @@ export {
|
||||
LaySpace,
|
||||
LayTag,
|
||||
LayTagInput,
|
||||
LayTreeSelect,
|
||||
install,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user