Skip to content

Commit 05814ec

Browse files
committed
commit
1 parent b02e5e7 commit 05814ec

27 files changed

+1293
-1
lines changed

.babelrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"presets": [
3+
["env", { "modules": false }],
4+
"es2015"
5+
],
6+
"plugins": ["transform-vue-jsx"]
7+
}

.gitattributes

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**/*.js linguist-language=Vue
2+
**/*.less linguist-language=Vue
3+
**/*.css linguist-language=Vue
4+
**/*.html linguist-language=Vue

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.DS_Store
2+
node_modules
3+
.idea
4+
example/dist
5+
gh-pages

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 vue-multiple
3+
Copyright (c) 2017
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# input
2+
3+
> Vue-based scrollbar component
4+
5+
## Install
6+
7+
```bash
8+
npm install vue-multiple-scrollbar -S
9+
```
10+
11+
## Quick Start
12+
13+
```bash
14+
import Vue from 'vue'
15+
import VmInput from 'vue-multiple-scrollbar'
16+
17+
Vue.component(VmScrollbar.name, VmScrollbar)
18+
```
19+
20+
For more information, please refer to [scrollbar](http://vue-multiple.github.io/scrollbar) in our documentation.
21+
22+
## Build Setup
23+
24+
``` bash
25+
# install dependencies
26+
npm install
27+
28+
# serve with hot reload at localhost:8080
29+
npm run demo:dev
30+
31+
# build for demo with minification
32+
npm run demo:build
33+
34+
# build for gh-pages with minification
35+
npm run demo:prepublish
36+
37+
# build for production with minification
38+
npm run build
39+
```
40+
41+
## LICENSE
42+
43+
[MIT](http://opensource.org/licenses/MIT)

build/gh-pages.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
npm run demo:prepublish
3+
cd gh-pages
4+
git init
5+
git add -A
6+
git commit -m 'update gh-pages'
7+
git push -f [email protected]:zhutianyu <[email protected]>/scrollbar.git master:gh-pages

build/webpack.config.js

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
var path = require('path')
2+
var webpack = require('webpack')
3+
var ExtractTextPlugin = require('extract-text-webpack-plugin')
4+
5+
module.exports = {
6+
entry: './src/index.js',
7+
output: {
8+
path: path.resolve(__dirname, '..', './lib'),
9+
filename: 'scrollbar.js',
10+
library: 'scrollbar',
11+
libraryTarget: 'umd'
12+
},
13+
externals: {
14+
vue: {
15+
root: 'Vue',
16+
commonjs: 'vue',
17+
commonjs2: 'vue',
18+
amd: 'vue'
19+
}
20+
},
21+
module: {
22+
rules: [
23+
{
24+
test: /\.vue$/,
25+
loader: 'vue-loader',
26+
options: {
27+
loaders: {
28+
css: 'vue-style-loader!css-loader',
29+
less: 'vue-style-loader!css-loader!less-loader',
30+
}
31+
// other vue-loader options go here
32+
}
33+
},
34+
{
35+
test: /\.css$/,
36+
use: [
37+
{ loader: 'style-loader' },
38+
{ loader: 'css-loader' }
39+
]
40+
},
41+
{
42+
test: /\.less$/,
43+
use: [
44+
{ loader: 'style-loader' },
45+
{ loader: 'css-loader' },
46+
{ loader: 'less-loader' }
47+
]
48+
},
49+
{
50+
test: /\.js$/,
51+
loader: 'babel-loader',
52+
exclude: /node_modules/
53+
},
54+
{
55+
test: /\.(png|jpg|gif|svg)$/,
56+
loader: 'file-loader',
57+
options: {
58+
name: '[name].[ext]?[hash]'
59+
}
60+
},
61+
{
62+
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
63+
loader: 'url-loader',
64+
query: {
65+
limit: 10000,
66+
name: path.posix.join('static', 'fonts/[name].[hash:7].[ext]')
67+
}
68+
}
69+
]
70+
},
71+
resolve: {
72+
extensions: ['.js', '.vue', '.json']
73+
},
74+
plugins: [
75+
new webpack.optimize.UglifyJsPlugin({
76+
sourceMap: true,
77+
compress: {
78+
warnings: false
79+
}
80+
})
81+
]
82+
}

build/webpack.example.base.conf.js

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
var path = require('path')
2+
var ExtractTextPlugin = require('extract-text-webpack-plugin')
3+
var isProduction = process.env.NODE_ENV === 'production'
4+
5+
module.exports = {
6+
entry: {
7+
app: './example/src/main.js'
8+
},
9+
output: {
10+
path: '/example',
11+
filename: '[name].js',
12+
publicPath: '/'
13+
},
14+
module: {
15+
rules: [
16+
{
17+
test: /\.vue$/,
18+
loader: 'vue-loader',
19+
options: {
20+
// other vue-loader options go here
21+
loaders: {
22+
css: isProduction ? ExtractTextPlugin.extract({
23+
fallback: 'vue-style-loader',
24+
use: 'css-loader'
25+
}) : 'vue-style-loader!css-loader',
26+
less: isProduction ? ExtractTextPlugin.extract({
27+
fallback: 'vue-style-loader',
28+
use: ['css-loader', 'less-loader']
29+
}) : 'vue-style-loader!css-loader!less-loader'
30+
}
31+
}
32+
},
33+
{
34+
test: /\.js$/,
35+
loader: 'babel-loader',
36+
exclude: /node_modules/
37+
},
38+
{
39+
test: /\.(png|jpg|gif|svg)$/,
40+
loader: 'file-loader',
41+
options: {
42+
name: '[name].[ext]?[hash]'
43+
}
44+
},
45+
{
46+
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
47+
loader: 'url-loader',
48+
query: {
49+
limit: 10000,
50+
name: path.posix.join('static', 'fonts/[name].[hash:7].[ext]')
51+
}
52+
}
53+
]
54+
}
55+
}

build/webpack.example.dev.conf.js

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
var webpack = require('webpack')
2+
var merge = require('webpack-merge')
3+
var baseWebpackConfig = require('./webpack.example.base.conf')
4+
var HtmlWebpackPlugin = require('html-webpack-plugin')
5+
var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
6+
7+
module.exports = merge(baseWebpackConfig, {
8+
module: {
9+
rules: [
10+
{
11+
test: /\.css$/,
12+
loader: 'vue-style-loader!css-loader'
13+
},
14+
{
15+
test: /\.less$/,
16+
loader: 'vue-style-loader!css-loader!less-loader'
17+
}
18+
]
19+
},
20+
// cheap-module-eval-source-map is faster for development
21+
devtool: '#cheap-module-eval-source-map',
22+
plugins: [
23+
new webpack.DefinePlugin({
24+
'process.env': {
25+
NODE_ENV: '"development"'
26+
}
27+
}),
28+
new webpack.NoEmitOnErrorsPlugin(),
29+
new HtmlWebpackPlugin({
30+
filename: 'index.html',
31+
template: 'example/index.html',
32+
inject: true
33+
}),
34+
new FriendlyErrorsPlugin()
35+
]
36+
})

build/webpack.example.prod.conf.js

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
var path = require('path')
2+
var webpack = require('webpack')
3+
var merge = require('webpack-merge')
4+
var baseWebpackConfig = require('./webpack.example.base.conf')
5+
var HtmlWebpackPlugin = require('html-webpack-plugin')
6+
var ExtractTextPlugin = require('extract-text-webpack-plugin')
7+
var isProduction = process.env.NODE_ENV === 'production'
8+
9+
module.exports = merge(baseWebpackConfig, {
10+
module: {
11+
rules: [
12+
{
13+
test: /\.css$/,
14+
loader: ExtractTextPlugin.extract({
15+
fallback: "vue-style-loader",
16+
use: "css-loader"
17+
})
18+
},
19+
{
20+
test: /\.less/,
21+
loader: ExtractTextPlugin.extract({
22+
fallback: "vue-style-loader",
23+
use: ["css-loader", "less-loader"]
24+
})
25+
}
26+
]
27+
},
28+
devtool: '#source-map',
29+
output: {
30+
path: path.resolve(__dirname, '..', `${isProduction ? './example/dist' : 'gh-pages'}`),
31+
publicPath: isProduction ? '/' : '/scrollbar',
32+
filename: 'js/[name].[chunkhash].js'
33+
},
34+
plugins: [
35+
new webpack.DefinePlugin({
36+
'process.env': {
37+
NODE_ENV: '"production"'
38+
}
39+
}),
40+
new webpack.optimize.UglifyJsPlugin({
41+
sourceMap: true,
42+
compress: {
43+
warnings: false
44+
}
45+
}),
46+
new ExtractTextPlugin({
47+
filename: 'css/[name].[contenthash].css',
48+
allChunks: true
49+
}),
50+
new HtmlWebpackPlugin({
51+
filename: 'index.html',
52+
template: 'example/index.html',
53+
inject: true,
54+
minify: {
55+
removeComments: true,
56+
collapseWhitespace: true,
57+
removeAttributeQuotes: true
58+
// more options:
59+
// https://github.com/kangax/html-minifier#options-quick-reference
60+
},
61+
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
62+
chunksSortMode: 'dependency'
63+
})
64+
]
65+
})

example/index.html

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!Doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport"
6+
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
7+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
8+
<title>scrollbar</title>
9+
</head>
10+
<body>
11+
<div id="app"></div>
12+
<!-- built files will be auto injected -->
13+
</body>
14+
</html>

0 commit comments

Comments
 (0)