Foxtable(狐表)用户栏目专家坐堂 → requirejs 的 html 和css插件 引用参数的问题。


  共有2641人关注过本帖树形打印复制链接

主题:requirejs 的 html 和css插件 引用参数的问题。

帅哥哟,离线,有人找我吗?
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:109720 积分:558310 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/6/29 14:31:00 [显示全部帖子]

1、理论上都是一一对应的,但是如果不需要依赖模块返回值,function是可以不需要对应的参数的,特别是css的加载就是这样,css加载后就生效不需要再另外赋值,所以也就不需要返回值。

特别注意的是,如果不需要返回值的模块,必须定义到define模块数组的最后面,如:

define(['publib/loginUtils', 'text!web_local/login/index.html', 'css!web_local/login/index.css','css!web_local/login/index2.css'], function (util, template)

如果放到中间,就不行了,如:

define(['publib/loginUtils', 'css!web_local/login/index.css', 'text!web_local/login/index.html','css!web_local/login/index2.css'], function (util, template)

2、这个是帮助写错了,已更正

 回到顶部