Skip to content
This repository has been archived by the owner on Jan 17, 2021. It is now read-only.

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
crossjs committed Nov 6, 2016
2 parents a800e6d + 474876b commit 32def68
Show file tree
Hide file tree
Showing 63 changed files with 1,173 additions and 511 deletions.
16 changes: 13 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
sudo: required
dist: trusty
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable

language: node_js

node_js:
- "5"
- "7"

before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3

before_install:
Expand Down
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<sub>Based on Vue 2.0</sub>
</p>
<p align="center">
<a href="https://travis-ci.org/crossjs/plato"><img src="https://img.shields.io/travis/crossjs/plato.svg?style=flat-square" alt="Travis"></a>
<a href="https://coveralls.io/github/crossjs/plato"><img src="https://img.shields.io/coveralls/crossjs/plato.svg?style=flat-square" alt="Coveralls"></a>
<a href="https://david-dm.org/crossjs/plato"><img src="https://david-dm.org/crossjs/plato.svg?style=flat-square" alt="dependencies"></a>
<a href="https://david-dm.org/crossjs/plato?type=dev"><img src="https://david-dm.org/crossjs/plato/dev-status.svg?style=flat-square" alt="devDependency Status"></a>
<a href="https://travis-ci.org/crossjs/plato"><img src="https://img.shields.io/travis/crossjs/plato/dev.svg?style=flat-square" alt="Travis"></a>
<a href="https://coveralls.io/github/crossjs/plato"><img src="https://img.shields.io/coveralls/crossjs/plato/dev.svg?style=flat-square" alt="Coveralls"></a>
<a href="https://david-dm.org/crossjs/plato"><img src="https://img.shields.io/david/crossjs/plato.svg?style=flat-square" alt="dependencies"></a>
<a href="https://david-dm.org/crossjs/plato?type=dev"><img src="https://img.shields.io/david/dev/crossjs/plato.svg?style=flat-square" alt="devDependency Status"></a>
</p>
<p align="center">
a Boilerplate for mobile SPAs use vue, vuex, vue-router<br>
Expand All @@ -19,18 +19,24 @@
# install dependencies
npm install

# start a mocking server at localhost:3001
npm run mock

# serve with hot reload at localhost:3000
npm run dev

# eslint, stylelint, unit and e2e test
npm test

# compile files for production
# compile files for production with minification
npm run compile

# test, clean, and compile
npm run build

# serve dist, like production
npm start

# generate demo site and push to gh-pages
npm run docs

Expand Down
1 change: 1 addition & 0 deletions doc/TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

- Nodemon has error with node < 6.8.0, so please use node 5.12.0 or latest
- Firefox 49 has error in e2e test on macOS, so please use firefox 44
- Selenium 3.0.1 NOT compatibility with travis, so use 2.53.1
- postcss-import 8.1.2 has a [bug](https://github.com/postcss/postcss-import/issues/207), should downgrade to 8.0.2
- 需要在 `body` 标签添加 `ontouchstart=""` 属性,才能激活移动端的 `:active` 伪类
1 change: 1 addition & 0 deletions mock/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
files for json-server
124 changes: 124 additions & 0 deletions mock/db.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"faq": [
{
"id": "1avg9fpei0.alia0duccb",
"title": "leancloud is REMOVED!",
"content": "use fake data instead"
},
{
"id": "1avg9fpei0.hrpkt5v3grg",
"title": "from 🇨🇳",
"content": "for the world"
},
{
"id": "1avg9fpei0.n45om0s6b78",
"title": "could be used in production?",
"content": "though still working in progress"
},
{
"id": "1avg9fpei0.rc84eok8ul",
"title": "得到",
"content": "点点滴滴"
},
{
"id": "1avg9fpei0.00psciss0lo",
"title": "saasfas",
"content": "asddasds"
},
{
"id": "1avg9fpei0.ar17bbqbthg",
"title": "poop",
"content": "monkeys"
},
{
"id": "1avg9fpei0.bf5705249k",
"title": "sfdsfsfdfs",
"content": "fsdafsdfsdf"
},
{
"id": "1avg9fpei0.sjvk7gv5jc8",
"title": "wwww",
"content": "wwww"
},
{
"id": "1avg9fpei0.0s8ri08ogf8",
"title": "Vue 2.0 is Here!",
"content": "https://medium.com/the-vue-point/vue-2-0-is-here-ef1f26acf4b8#.zi0jbpmom"
},
{
"id": "1avg9fpei0.hr3g287ns1",
"title": "dfgf",
"content": "fddgd"
},
{
"id": "1avg9fpei0.f8dcvqeukq",
"title": "测试一下 just a test",
"content": "看上去不错哦"
},
{
"id": "1avg9fpei0.it3fp87k708",
"title": "jjj",
"content": "jjjj"
},
{
"id": "1avg9fpei0.q99hus0bk",
"title": "使用了自定义的 tap 事件",
"content": "解决 300 毫秒延迟,还在进行更多的测试……"
},
{
"id": "1avg9fpei0.9t6a3odc0io",
"title": "4344",
"content": "444"
},
{
"id": "1avg9fpei0.fv6dddg64m8",
"title": "ttt",
"content": "tttt"
},
{
"id": "1avg9fpei0.hn5qqh7adv",
"title": "1212",
"content": "21242"
},
{
"id": "1avg9fpei0.jkgcu8rt28",
"title": "d",
"content": "dd"
},
{
"id": "1avg9fpei0.2n730tvn9fg",
"title": "13213",
"content": "12313"
},
{
"id": "1avg9fpei0.t5qr27tf30o",
"title": "sss",
"content": "ddd"
},
{
"id": "1avg9fpei0.tp06rfscto",
"title": "123",
"content": "456"
},
{
"id": "1avg9fpei0.c97duh41e9",
"title": "fffff",
"content": "ffff"
},
{
"id": "1avg9fpei0.316lmeshcj8",
"title": "123123",
"content": "123123123"
},
{
"id": "1avg9fpei0.rfd2nhvnnbg",
"title": "sdfsdfasdfas",
"content": "dfsdfasd"
},
{
"id": "1avg9fpei0.rlc6teb7f8",
"title": "test for normalizer",
"content": "test for normalizer"
}
]
}
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
"main": "src/index.js",
"scripts": {
"gfw": "npm i cross-env && cross-env CHROMEDRIVER_CDNURL=http://npm.taobao.org/mirrors/chromedriver PHANTOMJS_CDNURL=http://npm.taobao.org/mirrors/phantomjs npm install -r https://registry.npm.taobao.org",
"start": "serve ./dist",
"mock": "cross-env NODE_ENV=development DEBUG=plato* json-server --watch --port 3001 ./mock/db.json",
"dev": "cross-env NODE_ENV=development DEBUG=plato* webpack-dev-server --progress",
"e2e": "cross-env NODE_ENV=test DEBUG=plato* node ./test/e2e/runner.js --env firefox",
"e2e": "cross-env NODE_ENV=test DEBUG=plato* node ./test/e2e/runner.js",
"e2e:dev": "cross-env NODE_ENV=test DEBUG=plato* nodemon ./test/e2e/runner.js",
"unit": "cross-env NODE_ENV=test DEBUG=plato* karma start ./test/unit/runner.js",
"unit:dev": "npm run unit -- --watch",
Expand All @@ -23,40 +25,41 @@
},
"dependencies": {
"lodash.isplainobject": "^4.0.6",
"nuo": "^0.1.1",
"nuo": "^1.0.0",
"query-string": "^4.2.3",
"string-template": "^1.0.0",
"vue": "^2.0.3",
"vue": "^2.0.5",
"vue-router": "^2.0.1",
"vuex": "^2.0.0",
"vuex-actions": "^1.1.1",
"vuex-localstorage": "^0.2.0",
"vuex-localstorage": "^0.3.0",
"whatwg-fetch": "^1.0.0"
},
"devDependencies": {
"babel-loader": "^6.2.5",
"babel-loader": "^6.2.7",
"babel-plugin-__coverage__": "^11.0.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-preset-es2015": "^6.16.0",
"babel-preset-es2015": "^6.18.0",
"babel-preset-stage-0": "^6.16.0",
"babel-register": "^6.16.3",
"babel-register": "^6.18.0",
"bundle-loader": "^0.5.4",
"chai": "^3.5.0",
"chromedriver": "^2.24.1",
"chromedriver": "~2.24.1",
"copy-webpack-plugin": "^4.0.0",
"core-js": "^2.4.1",
"cross-env": "^3.1.3",
"cross-spawn": "^4.0.2",
"cross-spawn": "^5.0.1",
"css-loader": "^0.25.0",
"eslint": "^3.8.1",
"eslint": "^3.9.1",
"eslint-config-plato": "^0.0.1",
"eslint-friendly-formatter": "^2.0.6",
"eslint-loader": "^1.6.0",
"extract-text-webpack-plugin": "^2.0.0-beta.4",
"favicons-webpack-plugin": "^0.0.7",
"file-loader": "^0.9.0",
"html-webpack-plugin": "^2.24.0",
"html-webpack-plugin": "^2.24.1",
"json-loader": "^0.5.4",
"json-server": "^0.8.23",
"karma": "^1.3.0",
"karma-coverage": "^1.1.1",
"karma-es6-shim": "^1.0.0",
Expand All @@ -74,11 +77,12 @@
"postcss-cssnext": "^2.8.0",
"postcss-flexible": "^0.2.1",
"postcss-import": "~8.0.2",
"postcss-loader": "^1.0.0",
"postcss-loader": "^1.1.0",
"postcss-reporter": "^1.4.1",
"postcss-url": "^5.1.2",
"rimraf": "^2.5.4",
"selenium-server": "^2.53.1",
"serve": "^1.4.0",
"sinon": "^1.17.6",
"sinon-chai": "^2.8.0",
"style-loader": "^0.13.1",
Expand All @@ -87,14 +91,10 @@
"url-loader": "^0.5.7",
"vue-hot-reload-api": "^2.0.6",
"vue-html-loader": "^1.2.3",
"vue-loader": "^9.7.0",
"vue-loader": "^9.8.0",
"vue-style-loader": "^1.0.0",
"webpack": "^2.1.0-beta.25",
"webpack-dev-server": "^2.1.0-beta.9",
"webpack-dev-server": "^2.1.0-beta.10",
"yargs": "^6.3.0"
},
"engines": {
"node": ">= 5.10.0",
"npm": ">= 3.6.0"
}
}
1 change: 0 additions & 1 deletion src/assets/PLATO.svg

This file was deleted.

12 changes: 9 additions & 3 deletions src/components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,27 @@

小而美,少即多。

## 近期目标
## 设计

非侵入式,功能的实现不需要修改原有 DOM 结构,参见 `s-swiper`

## 目标

### 近期目标

编写尽量小的碎片化的组件,方便开发时灵活的组装,以应对多变的需求;

什么叫小?参见 `c-form`

在这里,我们要先将之前使用 [nd-form](https://github.com/ndfront/nd-form) 的习惯从记忆中抹去,让一切简单、轻量。

## 中期目标
### 中期目标

根据实践反馈,持续不断地完善组件;

参考借鉴外部开源项目,总结工作中的需求,在碎片化上稍稍封装一些偏重的组件。

## 远期目标
### 远期目标

搞个大新闻?

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/components/c-icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</template>

<script>
import aMaps from './assets/maps'
import entities from './assets/icon-entities'
export default {
data () {
Expand All @@ -13,7 +13,7 @@ export default {
},
beforeMount () {
this.html = aMaps[this.$slots.default[0].text] || ' '
this.html = entities[this.$slots.default[0].text] || ' '
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/c-picker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<div class="c-picker-cover"
:style="{'background-size': '100% ' + (size - 1) / 2 * itemHeight + 'px'}">
<div class="c-picker-highlight"
:style="{'height': itemHeight + 'px', 'transform': 'translateY(' + ((size - 1) / 2 * itemHeight) + 'px)'}"></div>
:style="{'height': itemHeight + 'px', 'transform': 'translate3d(0, ' + ((size - 1) / 2 * itemHeight) + 'px, 0)'}"></div>
</div>
<div class="c-picker-content" :class="{'transition' : transition}"
:style="{transform: 'translateY(' + offset + 'px)'}"
:style="{transform: 'translate3d(0, ' + offset + 'px, 0)'}"
ref="content"><slot></slot></div>
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/c-progress.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="c-progress">
<div class="c-progress-content"
:style="{'transform': 'translateX(-' + (100 - progress) + '%)'}"></div>
:style="{'transform': 'translate3d(-' + (100 - progress) + '%, 0, 0)'}"></div>
</div>
</template>

Expand Down
5 changes: 2 additions & 3 deletions src/components/c-scroller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
:style="{height: maxHeight + 'px'}">
<div class="c-scroller-content"
:class="{'transition' : transition}"
:style="{transform: 'translateY(' + offset + 'px)'}"
:style="{transform: 'translate3d(0, ' + offset + 'px, 0)'}"
ref="content">
<div class="c-scroller-indicator c-scroller-indicator-down"
ref="indicator">
Expand Down Expand Up @@ -66,8 +66,6 @@ export default {
data () {
return {
offset: 0,
// 临界阈值
threshold: 0,
// 推拉状态
pullState: 0,
// 溢出距离
Expand All @@ -92,6 +90,7 @@ export default {
},
mounted () {
// 临界阈值
this.threshold = this.$refs.indicator.clientHeight * this.bounce
this.fill()
},
Expand Down
Loading

0 comments on commit 32def68

Please sign in to comment.