<template>
	<view class="w-body">
		<w-public />
		<w-navbar left-back fixed title="一到五级地区选择器"></w-navbar>
		<view hover-class="w-hover-bg" style="padding: 1rem; margin: 1rem;" @click="proxy.$refs.citySelectRef.open(item.code)">{{ item.code }} {{ item.name || '请选择' }}</view>
		<view class="pre">{{ item }}</view>
		<c-city-select ref="citySelectRef" level="5" @change="item=$event;"/>
	</view>
</template>

<script setup>
import { onLoad, onShow, onReady } from '@dcloudio/uni-app'
import { ref, getCurrentInstance } from 'vue'

const { proxy } = getCurrentInstance()

const item = ref({})

onShow(async()=>{
	await proxy.$nextTick()
  // proxy.$refs.citySelectRef.open(code.value)
})
</script>

<style lang="scss" scoped>
.w-body {
	--navbar-height: 44px;
	background-color: var(--w-bg);
	font-size: .9rem;
	min-height: 100vh;
}
</style>
