file

文件操作

api

  1. /**
  2. *path 解压路径
  3. *callback 回调函数(参数:path(数组))
  4. **/
  5. unzip(path,callback)
  6. /**
  7. *path 解压路径
  8. *callback 回调函数
  9. **/
  10. ls(path,callback)

demo

  1. var net =weex.requireModule('net')
  2. var file =weex.requireModule('file')
  3. var url='http://xxxxx/img/xxx.zip'
  4. net.download(url,(percent)=>{
  5. this.percent=percent;
  6. },(e)=>{
  7. this.percent=e.path
  8. file.unzip(e.path,(res)=>{
  9. this.url=res.path[0]
  10. })
  11. },()=>{
  12. })