2018-03-26 16:04:04 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="md-example-child md-example-child-selector md-example-child-selector-2">
|
|
|
|
|
<md-field>
|
|
|
|
|
<md-field-item
|
|
|
|
|
title="确认模式"
|
2018-09-22 22:20:10 +08:00
|
|
|
:content="selectorValue"
|
|
|
|
|
@click="showSelector"
|
|
|
|
|
arrow
|
2018-12-03 21:29:22 +08:00
|
|
|
solid
|
2018-09-22 22:20:10 +08:00
|
|
|
/>
|
2018-03-26 16:04:04 +08:00
|
|
|
</md-field>
|
|
|
|
|
<md-selector
|
|
|
|
|
v-model="isSelectorShow"
|
|
|
|
|
:data="data[0]"
|
2018-12-03 21:29:22 +08:00
|
|
|
min-height="320px"
|
2018-03-26 16:04:04 +08:00
|
|
|
title="确认模式"
|
|
|
|
|
okText="确认"
|
2018-09-22 22:20:10 +08:00
|
|
|
@confirm="onSelectorConfirm"
|
2018-03-26 16:04:04 +08:00
|
|
|
></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-05-21 19:37:56 +08:00
|
|
|
title: '确认模式',
|
|
|
|
|
titleEnUS: 'Confirmed mode',
|
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: [
|
|
|
|
|
[
|
|
|
|
|
{
|
2018-09-22 22:20:10 +08:00
|
|
|
value: '1',
|
2018-03-26 16:04:04 +08:00
|
|
|
text: '选项一',
|
2018-12-03 21:29:22 +08:00
|
|
|
brief: '选项一说明',
|
2018-03-26 16:04:04 +08:00
|
|
|
},
|
|
|
|
|
{
|
2018-09-22 22:20:10 +08:00
|
|
|
value: '2',
|
2018-03-26 16:04:04 +08:00
|
|
|
text: '选项二',
|
2018-12-03 21:29:22 +08:00
|
|
|
brief: '选项二说明',
|
2018-03-26 16:04:04 +08:00
|
|
|
},
|
|
|
|
|
{
|
2018-09-22 22:20:10 +08:00
|
|
|
value: '3',
|
2018-03-26 16:04:04 +08:00
|
|
|
text: '选项三',
|
2018-12-03 21:29:22 +08:00
|
|
|
brief: '选项三说明',
|
2018-03-26 16:04:04 +08:00
|
|
|
},
|
|
|
|
|
{
|
2018-09-22 22:20:10 +08:00
|
|
|
value: '4',
|
2018-03-26 16:04:04 +08:00
|
|
|
text: '选项四',
|
2018-12-03 21:29:22 +08:00
|
|
|
brief: '选项四说明',
|
2018-03-26 16:04:04 +08:00
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
selectorValue: '',
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
showSelector() {
|
|
|
|
|
this.isSelectorShow = true
|
|
|
|
|
},
|
|
|
|
|
onSelectorConfirm({text}) {
|
|
|
|
|
this.selectorValue = text
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2018-09-22 22:20:10 +08:00
|
|
|
</script>
|