1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
| <script setup lang="ts">
| import { Input as VbenInput } from '../../ui/input';
| /**
| * 非通用组件 直接按业务来写
| */
| defineProps({
| captcha: {
| default: '',
| type: String,
| },
| label: {
| default: '验证码',
| type: String,
| },
| placeholder: {
| default: '验证码',
| type: String,
| },
| });
|
| defineEmits<{ captchaClick: [] }>();
|
| const modelValue = defineModel({ default: '', type: String });
| </script>
|
| <!-- 图片验证码 -->
| <template>
| <div class="flex w-full">
| <div class="flex-1">
| <VbenInput
| id="code"
| v-model="modelValue"
| :class="$attrs.class ?? {}"
| :label="label"
| :placeholder="placeholder"
| name="code"
| required
| type="text"
| />
| </div>
| <img
| :src="captcha"
| class="h-[40px] w-[115px] rounded-r-md"
| @click="$emit('captchaClick')"
| />
| </div>
| </template>
|
| <style lang="scss">
| /**
| 验证码输入框样式
| 去除右边的圆角
| */
| input[id='code'] {
| border-top-right-radius: 0;
| border-bottom-right-radius: 0;
| }
| </style>
|
|