AppJs

  • app.js 文件编译处理

  • 参数

    • {Object} [body] //节点信息

使用示例

  1. appJs(node, store){
  2. // process appJs
  3. }

编译结果示例

  • 编译前
  1. App({
  2. onLaunch(opts) {
  3. if (!wx.cloud) {
  4. console.error('请使用 2.2.3 或以上的基础库以使用云能力')
  5. } else {
  6. wx.cloud.init({
  7. env: config.envId,
  8. traceUser: true,
  9. })
  10. }
  11. }
  12. })
  • 编译后
  1. const _App = require("./__antmove/component/componentClass.js")("App");
  2. const _my = require("./__antmove/api/index.js")(my);
  3. _App({
  4. onLaunch(opts) {
  5. if (!_my.cloud) {
  6. console.error("请使用 2.2.3 或以上的基础库以使用云能力");
  7. } else {
  8. _my.cloud.init({
  9. env: config.envId,
  10. traceUser: true
  11. });
  12. }
  13. }
  14. })