Name Last Update
..
examples Loading commit data...
layouts Loading commit data...
other Loading commit data...
public Loading commit data...
views Loading commit data...
.gitignore Loading commit data...
.spmignore Loading commit data...
.travis.yml Loading commit data...
HISTORY.md Loading commit data...
README.md Loading commit data...
app.js Loading commit data...
config.rb Loading commit data...
gulpfile.js Loading commit data...
index.js Loading commit data...
package.json Loading commit data...
router.js Loading commit data...

yohobuy-mobile


开发环境部署:

  1. 安装node,执行npm install
  2. 安装spm,执行spm install
  3. gulp启动服务,浏览器访问localhost:5000

Tip: 使用gulp build可以启动spm build服务编译好的文件存入/dist/all.js(or all-debug.js);compass在服务启动时会自动执行编译并监听文件变化。

to 想调前端代码的后端开发者

安装nodejs

https://nodejs.org/

注意: 如果是mac系统记得sudo

安装spm

npm install -g spm 

安装ruby

如果是mac可以略过,这个已经存在。 windows用户点击这里http://rubyinstaller.org/

设置rubygem国内源

gem sources --remove https://rubygems.org/
gem sources -a https://ruby.taobao.org/
gem sources -l

安装compass

gem install compass

初始化项目

git clone http://git.dev.yoho.cn/web/yohobuy-frontend.git
cd yoho-frontend/mobile
npm install
spm install
spm doc|comapss watch

打开本地的JS和css

http://localhost:8000/examples/index.html

js,css调用方式

引用方式

seajs的路径

<script src="http://localhost:8000/static/js/sea.js?nowrap"></script>

配置样式表的路径

<link rel="stylesheet" type="text/css" href="http://localhost:8000/public/css/index.css">

配置seajs

  seajs.config({
    base: "/" //seajs加载器的js基础路径
  });

界面调用

var yohobuyMobile = seajs.use('index');

or

var yohobuyMobile = require('index');