有关setdata问题?
console.log("befor:" + that.shareImg);
that.setData({ shareImg: res.tempFilePath });
console.log("after:" + that.shareImg);
console.log(res.tempFilePath);
输出如下:
befor:undefined
after:undefined
http://tmp/wxb4f060XXXXXX7.png
undefined
那个shareimg我还有赋初始值,然而一样是未定义?不懂
js里面怎么才能用全局变量,困扰了一周,求救