<label class="label-with-icon" v-text="weatherstr" @click="open()"></label>
<unicloud-city-select ref="citySelect" :hot-city="hotCity" :location="true"
@select="selectCity"></unicloud-city-select>
const citySelect = ref(null); //城市选择组件
// 打开城市选择页面
function open() {
console.log(citySelect);
citySelect.value.open();
}
![2***@qq.com](https://img-cdn-tc.dcloud.net.cn/account/identicon/bc4206a8c1b4f7ab2a0cbbe61c34b0c7.png)
- 发布:2023-11-15 17:09
- 更新:2024-12-04 15:36
- 阅读:341
产品分类: uniCloud/App
示例代码:
操作步骤:
引入组件,右键插件database目录下的opendb-city-china.schema上传Schema,运行起来调用open()打开页面
引入组件,右键插件database目录下的opendb-city-china.schema上传Schema,运行起来调用open()打开页面
预期结果:
应该有城市数据
应该有城市数据
实际结果:
无城市数据
无城市数据
bug描述:
unicloud-city-select插件的
uni-city-list.vue中getCloudData()函数中
let dbRes = await db.collection("opendb-city-china").aggregate()
报错Uncaught (in promise) Error: request:ok
at s4 ()
at async fn.uni.showLoading.title ()
at async AsyncFunction.success ()
![](http://img-cdn-tc.dcloud.net.cn/uploads/questions/20231115/b0781d6be62606fd1734ee56e9def4be.jpg)