search

Home  >  Q&A  >  body text

javascript - sea.js require, sea.use difference

  1. Why pass a.js in a module var AppBridge = require('widget/util'); console.log(AppBridge) Cannot introduce util.js normally, print The result is null, and it must be called in other imported js b.js used on the page seajs.use(['widget/util'], function Util) {}) At this time a.js can The results of AppBridge are printed normally. What is happening?

给我你的怀抱给我你的怀抱2768 days ago553

reply all(1)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-19 10:43:35

    var AppBridge = require('widget/util'); util is relative to the location of the seajs file
    and seajs.use is directly relative

    reply
    0
  • Cancelreply