getFileSystemManager 中 rmdirSync 的 dirPath 非常确定为 string 类型,隐藏页面后,video控件如何停止播放?。但总会提示错误提示:
dirPat must be a string;at pages/index/index page lifeCycleMethod onLoad function Error: dirPat must be a string
是 BUG ? 还是我哪里写错了 ?
我的代码如下:
var fsm = wx.getFileSystemManager();
fsm.rmdirSync(
{
dirPath: ''+wx.env.USER_DATA_PATH + '/cp_icon/',
recursive: true, // 递归删除目录及其内部所有文件
success:function(rs)
{
console.log('删除成功');
console.log(rs);
},
fail:function(e)
{
console.log('删除失败');
console.log(e);
}
});
本文来自微信小程序开发者论坛 -微信小程序工厂 http://www.xcxgc.com,转载请保留,开发微信小程序、定制微信小程序来微信小程序工厂网。
网友回复
Sp**回复:
fsm.rmdirSync(dirPath, ...)
直接作为参数传进去,而不是放在 obj 里
本文网址:http://www.91bianli.com/kaifazhinan/62091.html