Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用components遇到问题,页面报错:没有require定义 #32

Open
ilife5 opened this issue Jun 19, 2015 · 1 comment
Open

使用components遇到问题,页面报错:没有require定义 #32

ilife5 opened this issue Jun 19, 2015 · 1 comment

Comments

@ilife5
Copy link

ilife5 commented Jun 19, 2015

我的使用方式如下。

目录结构

├── components
│   └── zepto
│       ├── README.md
│       ├── ajax.js
│       ├── assets.js
│       ├── callbacks.js
│       ├── component.json
│       ├── data.js
│       ├── deferred.js
│       ├── detect.js
│       ├── event.js
│       ├── form.js
│       ├── fx.js
│       ├── fx_methods.js
│       ├── gesture.js
│       ├── ie.js
│       ├── ios3.js
│       ├── main.js
│       ├── selector.js
│       ├── stack.js
│       ├── touch.js
│       └── zepto.js
├── fis-conf.js
└── src
    ├── html
    │   └── helloworld.html
    ├── scripts
    │   ├── biz
    │   │   └── helloworld
    │   │       └── helloworld.js
    │   └── common
    │       └── common.js
    └── styles

helloworld.html中的内容为:

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>

<script src="../scripts/common/common.js"></script>
<script src="../scripts/biz/helloworld/helloworld.js"></script>
</body>
</html>

common.js中的内容为:

require("zepto");

helloworld.js中的内容为:

console.log("hello world")

运行fis server start; fis release;之后,打开:http://127.0.0.1:8080/src/html/helloworld.html,报错

image

请问是不是我用的方式有问题?

@2betop
Copy link
Contributor

2betop commented Jun 19, 2015

你还需要一个前端 loader, 比如 mod.js ,请参考下 https://github.com/fex-team/fis-components-demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants