优化
This commit is contained in:
@@ -2,25 +2,18 @@ import type { PassThroughProps } from "../../types";
|
||||
|
||||
export type ClCropperPassThrough = {
|
||||
className?: string;
|
||||
inner?: PassThroughProps;
|
||||
image?: PassThroughProps;
|
||||
op?: PassThroughProps;
|
||||
opItem?: PassThroughProps;
|
||||
mask?: PassThroughProps;
|
||||
cropBox?: PassThroughProps;
|
||||
button?: PassThroughProps;
|
||||
};
|
||||
|
||||
export type ClCropperProps = {
|
||||
className?: string;
|
||||
pt?: ClCropperPassThrough;
|
||||
src?: string;
|
||||
width?: string | number;
|
||||
height?: string | number;
|
||||
cropWidth?: string | number;
|
||||
cropHeight?: string | number;
|
||||
cropWidth?: number;
|
||||
cropHeight?: number;
|
||||
maxScale?: number;
|
||||
showButtons?: boolean;
|
||||
quality?: number;
|
||||
format?: "jpg" | "png";
|
||||
disabled?: boolean;
|
||||
canResize?: boolean; // 是否可以自定义裁剪框大小
|
||||
canFlip?: boolean; // 是否显示翻转功能
|
||||
};
|
||||
resizable?: boolean;
|
||||
};
|
||||
|
||||
@@ -14,16 +14,23 @@
|
||||
<cl-text
|
||||
v-if="showText"
|
||||
:pt="{
|
||||
className: parseClass({
|
||||
'!text-surface-400': disabled
|
||||
})
|
||||
className: parseClass([
|
||||
{
|
||||
'!text-surface-400': disabled
|
||||
},
|
||||
pt.text?.className
|
||||
])
|
||||
}"
|
||||
ellipsis
|
||||
>
|
||||
{{ text }}
|
||||
</cl-text>
|
||||
|
||||
<text class="cl-select-trigger__placeholder" v-else>
|
||||
<text
|
||||
class="cl-select-trigger__placeholder"
|
||||
:class="[pt.placeholder?.className]"
|
||||
v-else
|
||||
>
|
||||
{{ placeholder }}
|
||||
</text>
|
||||
</view>
|
||||
@@ -53,6 +60,7 @@ import { computed } from "vue";
|
||||
import type { ClIconProps } from "../cl-icon/props";
|
||||
import { isDark, parseClass, parsePt } from "@/cool";
|
||||
import { t } from "@/locale";
|
||||
import type { PassThroughProps } from "../../types";
|
||||
|
||||
defineOptions({
|
||||
name: "cl-select-trigger"
|
||||
@@ -98,6 +106,8 @@ const emit = defineEmits(["clear"]);
|
||||
type PassThrough = {
|
||||
className?: string; // 根元素类名
|
||||
icon?: ClIconProps; // 图标样式
|
||||
placeholder?: PassThroughProps; // 占位符样式
|
||||
text?: PassThroughProps; // 文本样式
|
||||
};
|
||||
|
||||
// 解析透传样式配置
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import type { ClIconProps } from "../cl-icon/props";
|
||||
import type { PassThroughProps } from "../../types";
|
||||
|
||||
export type ClSelectTriggerPassThrough = {
|
||||
className?: string;
|
||||
icon?: ClIconProps;
|
||||
placeholder?: PassThroughProps;
|
||||
text?: PassThroughProps;
|
||||
};
|
||||
|
||||
export type ClSelectTriggerProps = {
|
||||
|
||||
@@ -14,5 +14,4 @@ export type ClSignProps = {
|
||||
minStrokeWidth?: number;
|
||||
maxStrokeWidth?: number;
|
||||
velocitySensitivity?: number;
|
||||
autoRotate?: boolean;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user