File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -9,4 +9,7 @@ export default {
9
9
cswitch04020 :
10
10
'使用activeText属性与inactiveText属性来设置开关的文字描述。 使用 inlinePrompt 属性来控制文本是否显示在点内。' ,
11
11
cswitch04030 : '使用activeText属性与inactiveText属性来设置开关的文字描述。' ,
12
+ cswitch05010 : '显示自定义图标' ,
13
+ cswitch05020 :
14
+ '使用 activeIcon 和 inactiveIcon slot来添加图标。 使用 inlinePrompt 属性来控制图标显示在点内。' ,
12
15
} ;
Original file line number Diff line number Diff line change 1
1
<script >
2
2
import { SvelSwitch } from ' @svelement-ui/all' ;
3
+ import { Check , Close } from ' @svelement-ui/icon' ;
3
4
import Example from ' $lib/example.svelte' ;
4
5
import { getContext } from ' svelte' ;
5
6
95
96
/>
96
97
</Example >
97
98
99
+ <h2 >{$langFn (' cswitch05010' )}</h2 >
100
+ <p >{$langFn (' cswitch05020' )}</p >
101
+ <Example
102
+ code ={`
103
+ <script>
104
+ import { Check, Close } from '@svelement-ui/icon';
105
+ @@@/>
106
+ <SvelSwitch>
107
+ <Check slot="activeIcon" />
108
+ <Close slot="inactiveIcon" />
109
+ </SvelSwitch>
110
+
111
+ <br />
112
+ <SvelSwitch inlinePrompt>
113
+ <Check slot="activeIcon" />
114
+ <Close slot="inactiveIcon" />
115
+ </SvelSwitch>
116
+ ` }
117
+ >
118
+ <SvelSwitch >
119
+ <Check slot =" activeIcon" />
120
+ <Close slot =" inactiveIcon" />
121
+ </SvelSwitch >
122
+
123
+ <br />
124
+ <SvelSwitch inlinePrompt >
125
+ <Check slot =" activeIcon" />
126
+ <Close slot =" inactiveIcon" />
127
+ </SvelSwitch >
128
+ </Example >
129
+
98
130
<style >
99
131
</style >
You can’t perform that action at this time.
0 commit comments