Skip to content

Commit 2517b8f

Browse files
committed
* picker: update Picker component examples to use new ZUI syntax, removing deprecated elements and enhancing clarity in usage.
1 parent 3f9e1df commit 2517b8f

File tree

1 file changed

+3
-26
lines changed

1 file changed

+3
-26
lines changed

lib/picker/docs/lib/forms/index.md

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
== 示例
1010

1111
<Example>
12-
<div id="singlePickerExample"></div>
12+
<ZUI use="picker" :options="{items, defaultValue: 'banana', name: 'picker', placeholder: '请选择你的最爱', searchHint: '搜索选项'}" />
1313
</Example>
1414

1515
== HTML
@@ -51,7 +51,7 @@ const picker = new zui.Picker('#singlePickerExample', {
5151
== 示例
5252

5353
<Example>
54-
<div id="multiPickerExample"></div>
54+
<ZUI use="picker" :options="{multiple: true, items, defaultValue: 'banana,orange', placeholder: '请选择你的最爱', menuCheckbox: true}" />
5555
</Example>
5656

5757
== HTML
@@ -95,7 +95,7 @@ const picker = new zui.Picker('#multiPickerExample', {
9595
<Example>
9696
<div class="input-group">
9797
<span class="input-group-addon">选择一种水果</span>
98-
<div class="input-group-control" data-zui="picker" data-items='[{"text": "Apple", "value": "apple"}, {"text": "Banana", "value": "banana"}]'></div>
98+
<ZUI use="picker" :options="{$class: 'input-group-control', items}" />
9999
<button type="button" class="btn btn-default" tabindex="-1">刷新</button>
100100
</div>
101101
</Example>
@@ -297,8 +297,6 @@ style?: object;
297297
</Props>
298298

299299
<script setup>
300-
import {onMounted} from 'vue';
301-
302300
const items = [
303301
{text: 'Apple', value: 'apple', keys: 'fruit food'},
304302
{text: 'Banana', value: 'banana', keys: 'fruit food'},
@@ -313,25 +311,4 @@ const items = [
313311
{text: 'Ben', value: 'ben', keys: 'human animals'},
314312
{text: 'Cake', value: 'cake', keys: 'food'},
315313
];
316-
317-
onMounted(() => {
318-
onZUIReady(() => {
319-
new zui.Picker('#singlePickerExample', {
320-
items,
321-
defaultValue: 'banana',
322-
name: 'picker',
323-
placeholder: '请选择你的最爱',
324-
searchHint: '搜索选项',
325-
});
326-
327-
new zui.Picker('#multiPickerExample', {
328-
multiple: true,
329-
items,
330-
defaultValue: 'banana,orange',
331-
name: 'picker',
332-
placeholder: '请选择你的最爱',
333-
menuCheckbox: true,
334-
});
335-
});
336-
});
337314
</script>

0 commit comments

Comments
 (0)