id 可以打印出来 为什么最后成空了呢?
onLoad: function (options) {
// this.getData(options)
this.getLocation()
const id = options.id
console.log(id)
markers_db.doc(id).get().then(res => {
console.log(res.data)
报错:
MiniProgramError
errCode: -1 | errMsg: collection.doc:fail docId must not be empty; at collection.doc api;
Error: errCode: -1 | errMsg: collection.doc:fail docId must not be empty; at collection.doc api;
你打印的id呢?是字符串吗?
错误信息说的是docId为空 应该是doc方法内部出的问题