12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <template>
- <view>
- <city-select @cityClick="cityClick" :formatName="formatName" :activeCity="activeCity" :hotCity="hotCity"
- :obtainCitys="obtainCitys" :isSearch="true" ref="citys">
- </city-select>
- </view>
- </template>
- <script>
- import citys from '@/components/city-select/citys.js'
- import citySelect from '@/components/city-select/city-select.vue'
- export default {
- data() {
- return {
- //需要构建索引参数的名称(注意:传递的对象里面必须要有这个名称的参数)
- formatName: 'cityName',
- //当前城市
- activeCity: {},
- //热门城市
- hotCity: [],
- //显示的城市数据
- obtainCitys: citys
- }
- },
- components: {
- citySelect
- },
- onShow() {
- },
- onLoad(body) {
- this.activeCity = JSON.parse(body.activeCity);
- },
- methods: {
- cityClick(item) {
- uni.$emit('changeCity', item);
- uni.navigateBack();
- }
- }
- }
- </script>
- <style></style>
|