-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 46d1a5d
Showing
9 changed files
with
200 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"presets": ["es2015", "stage-2"], | ||
"plugins": ["transform-runtime"], | ||
"comments": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.DS_Store | ||
node_modules/ | ||
dist/ | ||
npm-debug.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# vue-iscroll | ||
|
||
> A Vue.js project | ||
## Build Setup | ||
|
||
``` bash | ||
# install dependencies | ||
npm install | ||
|
||
# serve with hot reload at localhost:8080 | ||
npm run dev | ||
|
||
# build for production with minification | ||
npm run build | ||
``` | ||
|
||
For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>vue-iscroll</title> | ||
</head> | ||
<body> | ||
<app></app> | ||
<script src="dist/build.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "vue-iscroll", | ||
"description": "A Vue.js project", | ||
"author": "horizon0514", | ||
"private": true, | ||
"scripts": { | ||
"dev": "webpack-dev-server --inline --hot", | ||
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules" | ||
}, | ||
"dependencies": { | ||
"vue": "^1.0.0", | ||
"babel-runtime": "^6.0.0" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "^6.0.0", | ||
"babel-loader": "^6.0.0", | ||
"babel-plugin-transform-runtime": "^6.0.0", | ||
"babel-preset-es2015": "^6.0.0", | ||
"babel-preset-stage-2": "^6.0.0", | ||
"cross-env": "^1.0.6", | ||
"css-loader": "^0.23.0", | ||
"file-loader": "^0.8.4", | ||
"json-loader": "^0.5.4", | ||
"url-loader": "^0.5.7", | ||
"vue-hot-reload-api": "^1.2.0", | ||
"vue-html-loader": "^1.0.0", | ||
"vue-loader": "^8.2.1", | ||
"vue-style-loader": "^1.0.0", | ||
"webpack": "^1.12.2", | ||
"webpack-dev-server": "^1.12.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<template> | ||
<div id="app"> | ||
<h1>{{ msg }}</h1> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data () { | ||
return { | ||
// note: changing this line won't causes changes | ||
// with hot-reload because the reloaded component | ||
// preserves its current state and we are modifying | ||
// its initial state. | ||
msg: 'Hello Vue!' | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
body { | ||
font-family: Helvetica, sans-serif; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Vue from 'vue' | ||
import App from './App.vue' | ||
|
||
new Vue({ | ||
el: 'body', | ||
components: { App } | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<template> | ||
<div class="wrapper"> | ||
<div class="scroller"> | ||
<slot></slot> | ||
<slot name="pulldown"></slot> | ||
<slot name="pullup"></slot> | ||
</div> | ||
</div> | ||
</template> | ||
<script> | ||
var iScroll = require('iscroll/build/iscroll-lite') | ||
export default{ | ||
name: "vue-iscroller", | ||
props:{ | ||
}, | ||
} | ||
</script> | ||
<style scoped> | ||
.wrapper{ | ||
position: absolute; | ||
z-index: 1; | ||
top: 0; | ||
bottom: 48px; | ||
left: 0; | ||
width: 100%; | ||
overflow: hidden; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
var path = require('path') | ||
var webpack = require('webpack') | ||
|
||
module.exports = { | ||
entry: './src/main.js', | ||
output: { | ||
path: path.resolve(__dirname, './dist'), | ||
publicPath: '/dist/', | ||
filename: 'build.js' | ||
}, | ||
resolveLoader: { | ||
root: path.join(__dirname, 'node_modules'), | ||
}, | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.vue$/, | ||
loader: 'vue' | ||
}, | ||
{ | ||
test: /\.js$/, | ||
loader: 'babel', | ||
exclude: /node_modules/ | ||
}, | ||
{ | ||
test: /\.json$/, | ||
loader: 'json' | ||
}, | ||
{ | ||
test: /\.html$/, | ||
loader: 'vue-html' | ||
}, | ||
{ | ||
test: /\.(png|jpg|gif|svg)$/, | ||
loader: 'url', | ||
query: { | ||
limit: 10000, | ||
name: '[name].[ext]?[hash]' | ||
} | ||
} | ||
] | ||
}, | ||
devServer: { | ||
historyApiFallback: true, | ||
noInfo: true | ||
}, | ||
devtool: '#eval-source-map' | ||
} | ||
|
||
if (process.env.NODE_ENV === 'production') { | ||
module.exports.devtool = '#source-map' | ||
// http://vuejs.github.io/vue-loader/workflow/production.html | ||
module.exports.plugins = (module.exports.plugins || []).concat([ | ||
new webpack.DefinePlugin({ | ||
'process.env': { | ||
NODE_ENV: '"production"' | ||
} | ||
}), | ||
new webpack.optimize.UglifyJsPlugin({ | ||
compress: { | ||
warnings: false | ||
} | ||
}), | ||
new webpack.optimize.OccurenceOrderPlugin() | ||
]) | ||
} |