index.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <view class="u-demo">
  3. <view class="u-demo-wrap">
  4. <view class="u-demo-title">演示效果</view>
  5. <view class="u-demo-area">
  6. <city-select v-model="value" @city-change="cityChange"></city-select>
  7. <view class="u-demo-result-line">{{ input ? input : 'Picker值' }}</view>
  8. </view>
  9. </view>
  10. <view class="u-config-wrap">
  11. <view class="u-config-title u-border-bottom">参数配置</view>
  12. <view class="u-config-item">
  13. <view class="u-item-title">状态</view>
  14. <u-button @click="value = true">打开Picker</u-button>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. import citySelect from '@/pages_template/components/u-city-select/u-city-select.vue';
  21. export default {
  22. components: {
  23. citySelect
  24. },
  25. data() {
  26. return {
  27. height: 30,
  28. bgColor: this.$u.color.bgColor,
  29. marginTop: 30,
  30. marginBottom: 30,
  31. value: false,
  32. input: '',
  33. };
  34. },
  35. methods: {
  36. cityChange(e) {
  37. this.input = e.province.label + '-' + e.city.label + '-' + e.area.label;
  38. this.input += e.province.value + '-' + e.city.value + '-' + e.area.value;
  39. }
  40. }
  41. };
  42. </script>
  43. <style scoped>
  44. .btn-wrap {
  45. margin: 100rpx 30rpx;
  46. }
  47. </style>