Skip to content

define 函数的依赖引入问题 #16

@Claiyre

Description

@Claiyre

您好!我在使用define函数,引入的依赖文件并没有以参数的形式传递给目标函数(通常是define的第三个会第二个参数)

代码如下:

index.js

var f=function(_tpl, _tab, _myUtil){
console.log(_tpl, _tab, _myUtil);                // undefined, undefined, undefined

// ...
}
define([
    '{lib}util/template/tpl.js',
    '{lib}util/tab/tab.js',
    './util.js'], f)

其中,util.js是我自己写的一个js文件,和index.js在同一目录下

所参考的NEJ文档

2018-03-07_205123

参考文档链接

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions