javascript - sea.js require, sea.use difference
给我你的怀抱
给我你的怀抱 2017-05-19 10:41:35
0
1
532
  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?

给我你的怀抱
给我你的怀抱

reply all(1)
仅有的幸福

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template