|
@@ -8,7 +8,7 @@
|
|
|
<el-col :span="24" class="main">
|
|
|
<van-field readonly clickable name="picker" :value="value" label="选择器" placeholder="点击选择城市" @click="showPicker = true" />
|
|
|
<van-popup v-model="showPicker" position="bottom">
|
|
|
- <van-picker show-toolbar :columns="columns" @confirm="onConfirm" @cancel="showPicker = false" />
|
|
|
+ <van-picker show-toolbar :columns="columns" @confirm="onConfirm" @cancel="showPicker = false" value-key="name" />
|
|
|
</van-popup>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="foot">
|
|
@@ -41,17 +41,26 @@ export default {
|
|
|
value: '',
|
|
|
showPicker: false,
|
|
|
columns: [
|
|
|
- { id: '1', name: '1' },
|
|
|
- { id: '2', name: '2' },
|
|
|
- { id: '3', name: '3' },
|
|
|
- { id: '4', name: '4' },
|
|
|
+ { id: '1', name: '长春' },
|
|
|
+ { id: '2', name: '吉林' },
|
|
|
+ { id: '3', name: '沈阳' },
|
|
|
+ { id: '4', name: '大连' },
|
|
|
],
|
|
|
+ // columns: ['长春', '吉林', '沈阳', '大连'],
|
|
|
+ // columns: [
|
|
|
+ // { id: '1', text: '长春' },
|
|
|
+ // { id: '2', text: '吉林' },
|
|
|
+ // { id: '3', text: '沈阳' },
|
|
|
+ // { id: '4', text: '大连' },
|
|
|
+ // ],
|
|
|
};
|
|
|
},
|
|
|
created() {},
|
|
|
methods: {
|
|
|
onConfirm(value) {
|
|
|
- console.log(value);
|
|
|
+ this.value = value.name;
|
|
|
+ this.showPicker = false;
|
|
|
+ // console.log(value);
|
|
|
},
|
|
|
},
|
|
|
computed: {
|