wangzhibo
4 天以前 10595d8632f959d0954d1939243196f4eed02372
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
59
60
61
<template>
    <cl-page :padding="20">
        <cl-card label="基础用法">
            <cl-input />
        </cl-card>
 
        <cl-card label="数字键盘">
            <cl-input type="number" />
        </cl-card>
 
        <cl-card label="禁用">
            <view style="margin-bottom: 20rpx">
                <cl-button
                    size="small"
                    :type="disabled ? 'success' : 'error'"
                    @tap="disabled = !disabled"
                >
                    {{ disabled ? "启用" : "禁用" }}
                </cl-button>
            </view>
 
            <cl-input :disabled="disabled" />
        </cl-card>
 
        <cl-card label="无边框">
            <cl-input :border="false" />
        </cl-card>
 
        <cl-card label="前置元素">
            <cl-input>
                <template #prepend>
                    <text>https://</text>
                </template>
            </cl-input>
        </cl-card>
 
        <cl-card label="后置元素">
            <cl-input>
                <template #append>
                    <text>元</text>
                </template>
            </cl-input>
        </cl-card>
 
        <cl-card label="自定义">
            <cl-input
                :height="80"
                :padding="[0, 32, 0, 32]"
                :radius="16"
                background-color="#eee"
                :border="false"
            />
        </cl-card>
    </cl-page>
</template>
 
<script lang="ts" setup>
import { ref } from "vue";
 
const disabled = ref(true);
</script>