水煮坦克
水煮坦克
  • 发布:2024-04-29 09:57
  • 更新:2024-04-29 16:25
  • 阅读:32

下面代码想在本地查找表格的数据,为什么then和catch都没有反应

分类:uniCloud

<template>
<view>
<view class="content">
<button @click="search_admin_menus()">点击:在表里查找数据</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {

        }  
    },  
    methods: {   
        async search_admin_menus() {  
            const db = uniCloud.database()  
            db.collection('opendb-admin-menus')  
              .where('name == "首页"')  
              .get()  
              .then((res)=>{  
                  console.log(res);  
                  }  
              ).catch((err)=>{  
                  console.log('未查询到符合条件的数据');  
              })  
        }  
    }  
}  

</script>

2024-04-29 09:57 负责人:无 分享
已邀请:
DCloud_uniCloud_VK

DCloud_uniCloud_VK

F12看下控制台有打印什么或报错

要回复问题请先登录注册