File tree Expand file tree Collapse file tree 2 files changed +49
-11
lines changed Expand file tree Collapse file tree 2 files changed +49
-11
lines changed Original file line number Diff line number Diff line change @@ -5,4 +5,8 @@ export default {
5
5
cswitch02020 :
6
6
'绑定 value 到一个 Boolean 类型的变量。 可以使用 --svel-switch-on-color 属性与 --svel-switch-off-color 属性来设置开关的背景色。' ,
7
7
cswitch03010 : '尺寸' ,
8
+ cswitch04010 : '文字描述' ,
9
+ cswitch04020 :
10
+ '使用activeText属性与inactiveText属性来设置开关的文字描述。 使用 inlinePrompt 属性来控制文本是否显示在点内。' ,
11
+ cswitch04030 : '使用activeText属性与inactiveText属性来设置开关的文字描述。' ,
8
12
} ;
Original file line number Diff line number Diff line change 41
41
42
42
<Example
43
43
code ={`
44
- <script>
45
- import { SvelSwitch } from '@svelement-ui/all';
46
- let value1 = true;
47
- let value2 = true;
48
- @@@/>
49
- <SvelSwitch bind:value={value1} />
50
- <SvelSwitch
51
- bind:value={value2}
52
- class="ml-2"
53
- style="--svel-switch-on-color: #13ce66; --svel-switch-off-color: #ff4949"
54
- />
44
+ <SvelSwitch activeText="Open" inactiveText="Close" size="large" />
45
+ <br />
46
+ <SvelSwitch activeText="Open" inactiveText="Close" />
47
+ <br />
48
+ <SvelSwitch activeText="Open" inactiveText="Close" size="small" />
55
49
` }
56
50
>
57
51
<SvelSwitch activeText =" Open" inactiveText =" Close" size =" large" />
61
55
<SvelSwitch activeText =" Open" inactiveText =" Close" size =" small" />
62
56
</Example >
63
57
58
+ <h2 >{$langFn (' cswitch04010' )}</h2 >
59
+ <p >{$langFn (' cswitch04020' )}</p >
60
+ <p >{$langFn (' cswitch04030' )}</p >
61
+
62
+ <Example
63
+ code ={`
64
+ <SvelSwitch activeText="Open" inactiveText="Close" size="large" />
65
+ <br />
66
+ <SvelSwitch activeText="Open" inactiveText="Close" />
67
+ <br />
68
+ <SvelSwitch activeText="Open" inactiveText="Close" size="small" />
69
+ ` }
70
+ >
71
+ <SvelSwitch activeText =" Pay by month" class =" mb-2" inactiveText =" Pay by year" />
72
+ <br />
73
+ <SvelSwitch
74
+ activeText =" Pay by month"
75
+ class =" mb-2"
76
+ inactiveText =" Pay by year"
77
+ style =" --svel-switch-on-color: #13ce66; --svel-switch-off-color: #ff4949"
78
+ />
79
+ <br />
80
+ <SvelSwitch activeText =" 是" inactiveText =" 否" inlinePrompt />
81
+ <SvelSwitch
82
+ activeText =" Y"
83
+ class =" ml-2"
84
+ inactiveText =" N"
85
+ inlinePrompt
86
+ style =" --svel-switch-on-color: #13ce66; --svel-switch-off-color: #ff4949"
87
+ />
88
+ <SvelSwitch activeText =" 超出省略" class =" ml-2" inactiveText =" 超出省略" inlinePrompt width =" 60" />
89
+ <SvelSwitch
90
+ activeText =" 完整展示多个内容"
91
+ class =" ml-2"
92
+ inactiveText =" 多个内容"
93
+ inlinePrompt
94
+ style =" --svel-switch-on-color: #13ce66; --svel-switch-off-color: #ff4949"
95
+ />
96
+ </Example >
97
+
64
98
<style >
65
99
</style >
You can’t perform that action at this time.
0 commit comments