Selector

For selecting an item from the popup list

Import

import { Selector } from  'mand-mobile-next'

Vue.createApp().component(Selector.name, Selector)

Code Examples

API

Selector Props

PropsDescriptionTypeDefaultNote
v-modeldisplay selector or notBooleanfalse-
datadata sourceArray<{value,text,disabled,...}>[]text can be a html fragment
default-valuethe value of initially selected itemany-when multi is true, default-value should be array
titletitle of selectorString--
describedescription of selectorString--
ok-textconfirmation textString-if empty, it will be confirmed mode, that is, click to select directly
cancel-textcancellation textStringcancel-
hide-title-barhide title barBooleanfalse-
mask-closableif the popup will be closed when clicking maskBooleantrue-
is-checkhas a check icon or notBooleanfalseonly for confirmed mode
max-heightthe maximum height of selectable areaNumber/Stringauto-
min-heightthe minimum height of selectable areaNumber/Stringauto-
iconicon of selected optionStringchecked-
icon-inverseicon of unselected optionsStringcheck-
icon-disabledicon of disabled optionsStringcheck-disabled-
icon-sizethe size of iconStringlg-
icon-svguse svg iconBooleanfalse-
icon-positionthe position of iconStringrightleft, right
multisupport multi selectBooleanfalsemulti must be with ok-text prop

Selector Events

@choose({value, text, ...})

Select one item

@confirm({value, text, ...})

Confirm selection

@cancel()

Cancel selection

@show()

Show selector

@hide()

Hide selector

Selector Slots

default
<md-selector>
  <template slot-scope="{ option, index, selected }">
    <div class="md-selector-custom-title">Hello, {{ option.text }}</div>
  </template>
</md-selector>

header slot

footer slot