2018-03-26 16:04:04 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="md-example-child md-example-child-selector md-example-child-selector-0">
|
|
|
|
|
<md-field>
|
|
|
|
|
<md-field-item
|
|
|
|
|
name="name"
|
|
|
|
|
title="普通模式"
|
|
|
|
|
arrow="arrow-right"
|
|
|
|
|
align="right"
|
|
|
|
|
:value="selectorValue"
|
|
|
|
|
@click.native="showSelector">
|
|
|
|
|
</md-field-item>
|
|
|
|
|
</md-field>
|
|
|
|
|
<md-selector
|
|
|
|
|
v-model="isSelectorShow"
|
|
|
|
|
:data="data[0]"
|
|
|
|
|
:default-index="1"
|
|
|
|
|
:invalid-index="2"
|
|
|
|
|
title="普通模式"
|
|
|
|
|
@choose="onSelectorChoose($event)"
|
|
|
|
|
></md-selector>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2018-05-21 19:37:56 +08:00
|
|
|
<script>
import {Selector, Field, FieldItem} from 'mand-mobile'
|
2018-03-26 16:04:04 +08:00
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: 'selector-demo',
|
2018-05-02 15:54:19 +08:00
|
|
|
/* DELETE */
|
2018-03-26 16:04:04 +08:00
|
|
|
title: '无需确认',
|
2018-05-21 19:37:56 +08:00
|
|
|
titleEnUS: 'No need to confirm',
|
2018-09-13 11:19:46 +08:00
|
|
|
height: 400,
|
2018-05-02 15:54:19 +08:00
|
|
|
/* DELETE */
|
2018-03-26 16:04:04 +08:00
|
|
|
components: {
|
|
|
|
|
[Selector.name]: Selector,
|
|
|
|
|
[Field.name]: Field,
|
|
|
|
|
[FieldItem.name]: FieldItem,
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
isSelectorShow: false,
|
|
|
|
|
data: [
|
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
text: '选项一',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: '选项二',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: '选项三',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: '选项四',
|
|
|
|
|
},
|
2018-07-24 13:16:28 +08:00
|
|
|
{
|
|
|
|
|
text: '选项五',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: '选项六',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: '选项七',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: '选项八',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: '选项九',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: '选项十',
|
|
|
|
|
},
|
2018-03-26 16:04:04 +08:00
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
selectorValue: '选项二',
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
showSelector() {
|
|
|
|
|
this.isSelectorShow = true
|
|
|
|
|
},
|
|
|
|
|
onSelectorChoose({text}) {
|
|
|
|
|
this.selectorValue = text
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2018-05-21 19:37:56 +08:00
|
|
|
</script>
|