mirror of
https://gitee.com/dapppp/ruoyi-plus-vben5.git
synced 2026-03-08 07:31:09 +08:00
* chore(@vben/common-ui): 增加拖拽校验组件 * chore: 增加样式 * Merge branch 'main' into wangjue-verify-comp * chore: 封装action组件 * chore: 拆分完成拖拽功能 * chore: 样式调整为tailwindcss语法 * chore: 导出check图标 * chore: 拖动的图标变为@vben/icons的 * chore: 完成插槽功能迁移 * fix: ci error * chore: 适配暗黑主题 * chore: 国际化 * chore: resolve conflict * chore: 迁移v2的图片旋转校验组件 * chore: 完善选择校验demo * chore: 转换为tailwindcss * chore: 替换为系统的颜色变量 * chore: 使用interface代替组件的props声明 * chore: 调整props * chore: 优化demo背景 * chore: follow suggest * chore: rm unnecessary style tag * chore: update demo * perf: improve the experience of Captcha components --------- Co-authored-by: vince <vince292007@gmail.com> Co-authored-by: Vben <ann.vben@gmail.com>
53 lines
1023 B
Vue
53 lines
1023 B
Vue
<script setup lang="ts">
|
|
import type { CSSProperties } from 'vue';
|
|
import { computed, useTemplateRef } from 'vue';
|
|
|
|
import { VbenSpineText } from '@vben-core/shadcn-ui';
|
|
|
|
const props = defineProps<{
|
|
contentStyle: CSSProperties;
|
|
isPassing: boolean;
|
|
successText: string;
|
|
text: string;
|
|
}>();
|
|
|
|
const contentRef = useTemplateRef<HTMLDivElement>('contentRef');
|
|
|
|
const style = computed(() => {
|
|
const { contentStyle } = props;
|
|
|
|
return {
|
|
...contentStyle,
|
|
};
|
|
});
|
|
|
|
defineExpose({
|
|
getEl: () => {
|
|
return contentRef.value;
|
|
},
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<div
|
|
ref="contentRef"
|
|
:class="{
|
|
[$style.success]: isPassing,
|
|
}"
|
|
:style="style"
|
|
class="absolute top-0 flex size-full select-none items-center justify-center text-xs"
|
|
>
|
|
<slot name="text">
|
|
<VbenSpineText class="flex h-full items-center">
|
|
{{ isPassing ? successText : text }}
|
|
</VbenSpineText>
|
|
</slot>
|
|
</div>
|
|
</template>
|
|
|
|
<style module>
|
|
.success {
|
|
-webkit-text-fill-color: hsl(0deg 0% 98%);
|
|
}
|
|
</style>
|