weex icon indicating copy to clipboard operation
weex copied to clipboard

请问weex 里面可以加载nodejs的模块fs 不呢

Open 1459416736 opened this issue 10 years ago • 3 comments

请问weex 里面可以加载nodejs的模块fs 不呢? 我的代码var fs = require('fs'); 运行后提示:Cannot find module "fs" 找不到模块

1459416736 avatar Nov 16 '16 03:11 1459416736

不可以,暂不支持 node 环境,只能在浏览器或者 iOS 和 Android 中运行。

Weex: A framework for building Mobile cross-platform UI.

不建议用 Weex 写 node 程序 ……

Hanks10100 avatar Nov 16 '16 04:11 Hanks10100

那还没有其他办法生成json文件

1459416736 avatar Nov 16 '16 04:11 1459416736

为什么要在客户端上生成 json 文件呢,可能需要再重新构思一下这种需求。如果是想写文件的话,这种操作与平台接口关系比较大,应该由平台(客户端)提供,可以用自定义 weex 模块实现。

Hanks10100 avatar Nov 16 '16 05:11 Hanks10100