123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <template>
- <view class="content">
- {{title}}
- <u-button @click="show" type="primary" text="选择城市"></u-button>
- <!-- 城市组件 -->
- <city ref="city" @confirm="confirm"></city>
- </view>
- </template>
- <script>
- import city from '@/components/city-index/index.vue'
- export default {
- components: {
- city
- },
- data() {
- return {
- title:''
- }
- },
- onLoad() {
- },
- methods: {
- // 确定选择
- confirm(e,e1,e2) {
- console.log(e,e1,e2)
- this.title = e.name+e1.name+e2.name
- },
- // 显示
- show() {
- this.$refs.city.showd()
- }
- }
- }
- </script>
- <style>
- .content {
- padding: 100rpx;
- }
- </style>
|