2020-08-13 11:47:56 +08:00
|
|
|
<template>
|
|
|
|
<article>
|
|
|
|
<veui-select
|
|
|
|
v-model="item"
|
|
|
|
placeholder="Pick one..."
|
|
|
|
clearable
|
|
|
|
>
|
|
|
|
<veui-option-group
|
|
|
|
label="Editors"
|
|
|
|
position="popup"
|
|
|
|
>
|
|
|
|
<veui-option
|
|
|
|
value="vscode"
|
|
|
|
label="VSCode"
|
|
|
|
/>
|
|
|
|
<veui-option
|
|
|
|
value="sublime"
|
|
|
|
label="SublimeText"
|
|
|
|
/>
|
|
|
|
<veui-option
|
|
|
|
value="atom"
|
|
|
|
label="Atom"
|
|
|
|
/>
|
|
|
|
</veui-option-group>
|
|
|
|
<veui-option-group
|
|
|
|
label="Browsers"
|
|
|
|
position="popup"
|
|
|
|
>
|
|
|
|
<veui-option-group
|
|
|
|
label="Desktop"
|
|
|
|
position="popup"
|
|
|
|
>
|
|
|
|
<veui-option
|
|
|
|
value="ie"
|
|
|
|
label="IE"
|
|
|
|
/>
|
|
|
|
<veui-option
|
|
|
|
value="edge"
|
|
|
|
label="Edge"
|
|
|
|
/>
|
|
|
|
<veui-option
|
|
|
|
value="firefox"
|
|
|
|
label="Firefox"
|
|
|
|
/>
|
|
|
|
<veui-option
|
|
|
|
value="chrome"
|
|
|
|
label="Chrome"
|
|
|
|
/>
|
|
|
|
</veui-option-group>
|
|
|
|
<veui-option-group
|
|
|
|
label="Mobile"
|
|
|
|
position="popup"
|
|
|
|
>
|
|
|
|
<veui-option
|
|
|
|
value="ios_safari"
|
|
|
|
label="iOS Safari"
|
|
|
|
/>
|
|
|
|
<veui-option
|
|
|
|
value="android"
|
|
|
|
label="Android Browser"
|
|
|
|
/>
|
|
|
|
<veui-option
|
|
|
|
value="android_chrome"
|
|
|
|
label="Chrome for Android"
|
|
|
|
/>
|
|
|
|
</veui-option-group>
|
|
|
|
</veui-option-group>
|
|
|
|
</veui-select>
|
|
|
|
<p>Selected: {{ item || '-' }}</p>
|
|
|
|
</article>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { Select, OptionGroup, Option } from 'veui'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
'veui-select': Select,
|
|
|
|
'veui-option-group': OptionGroup,
|
|
|
|
'veui-option': Option
|
|
|
|
},
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
item: null
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2021-09-15 20:03:51 +08:00
|
|
|
<style lang="less" scoped>
|
2020-08-13 11:47:56 +08:00
|
|
|
.veui-select {
|
|
|
|
width: 180px;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<docs>
|
2021-10-20 01:11:27 +08:00
|
|
|
可以使用 [`clearable`](#props-clearable) 属性将 `Select` 组件设置为允许删除已选值的模式。将 `OptionGroup` 的 [`position`](./option-group#props-position) 属性设置为 `popup` 后可以让子选项在新的浮动子菜单中展现。
|
2020-08-13 11:47:56 +08:00
|
|
|
</docs>
|
|
|
|
|
|
|
|
<docs locale="en-US">
|
|
|
|
`clearable` can be used to allow selected values to be discarded for `Select`. Set `position` of the embedded `OptionGroup`s to `popup` to display children options inside a popup menu.
|
|
|
|
</docs>
|