Skip to content

Commit 97e67fe

Browse files
committed
Initial commit for vue 2
1 parent 30bf093 commit 97e67fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+887
-714
lines changed

.editorconfig

-9
This file was deleted.

.eslintignore

-2
This file was deleted.

.eslintrc.js

-22
This file was deleted.

LICENSE

-21
This file was deleted.

README.md

+13-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
A Vue component for file uploads, powered by [Dropzone.js](http://www.dropzonejs.com/). [Check out the demo](https://rowanwins.github.io/vue-dropzone/dist/index.html).
44

5+
## Install
6+
````
7+
// For Vue.js 2.0+
8+
npm install vue-dropzone^2.0.0
9+
10+
// For Vue.js 1.0+
11+
npm install [email protected]
12+
13+
````
14+
515
## Usage
616
1. Import the module
717
2. Register it as a component as you would any other Vue component
@@ -13,7 +23,7 @@ A Vue component for file uploads, powered by [Dropzone.js](http://www.dropzonejs
1323
<div id="app">
1424
<p>Welcome to your Vue.js app!</p>
1525
16-
<dropzone id="myVueDropzone" url="https://httpbin.org/post"></dropzone>
26+
<dropzone id="myVueDropzone" url="https://httpbin.org/post" v-on:vdropzone-success="showSuccess"></dropzone>
1727
1828
</div>
1929
</template>
@@ -26,8 +36,8 @@ A Vue component for file uploads, powered by [Dropzone.js](http://www.dropzonejs
2636
components: {
2737
Dropzone
2838
},
29-
events: {
30-
'vdropzone-success': function (file) {
39+
methods: {
40+
'showSuccess': function (file) {
3141
console.log('A file was successfully uploaded')
3242
}
3343
}

build/base.js

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
var path = require('path')
2+
var webpack = require('webpack')
3+
4+
module.exports = {
5+
resolveLoader: {
6+
root: path.join(__dirname, '../node_modules'),
7+
},
8+
resolve: {
9+
extensions: ['', '.js', '.vue'],
10+
alias: {
11+
'vue$': 'vue/dist/vue.js'
12+
}
13+
},
14+
module: {
15+
loaders: [
16+
{
17+
test: /\.vue$/,
18+
loader: 'vue'
19+
},
20+
{
21+
test: /\.js$/,
22+
loader: 'babel',
23+
exclude: /node_modules/
24+
},
25+
{
26+
test: /\.css$/,
27+
loader: 'style!css!autoprefixer'
28+
},
29+
{
30+
test: /\.json$/,
31+
loader: 'json'
32+
},
33+
{
34+
test: /\.(png|jpg|gif|svg)$/,
35+
loader: 'url',
36+
query: {
37+
limit: 10000,
38+
name: '[name].[ext]?[hash]'
39+
}
40+
}
41+
]
42+
}
43+
}

build/build.js

-35
This file was deleted.

build/dev-client.js

-9
This file was deleted.

build/dev-server.js

-65
This file was deleted.

build/dev.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
var path = require('path');
2+
var webpack = require('webpack');
3+
var config = require('./base');
4+
5+
module.exports = Object.assign({}, config, {
6+
entry: './dev/index.js',
7+
output: {
8+
path: path.resolve(__dirname, '../dev'),
9+
publicPath: '/dev/',
10+
filename: 'bundle.js'
11+
},
12+
devServer: {
13+
historyApiFallback: true,
14+
noInfo: true
15+
},
16+
devtool: '#eval-source-map'
17+
});
18+
19+
if (process.env.NODE_ENV === 'production') {
20+
module.exports.devtool = '#source-map'
21+
// http://vuejs.github.io/vue-loader/workflow/production.html
22+
module.exports.plugins = (module.exports.plugins || []).concat([
23+
new webpack.DefinePlugin({
24+
'process.env': {
25+
NODE_ENV: '"production"'
26+
}
27+
}),
28+
new webpack.optimize.UglifyJsPlugin({
29+
compress: {
30+
warnings: false
31+
}
32+
}),
33+
new webpack.optimize.OccurenceOrderPlugin()
34+
])
35+
}

build/prod.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
var path = require('path')
2+
var config = require('./base');
3+
var webpack = require('webpack')
4+
5+
module.exports = Object.assign({}, config, {
6+
entry: './src/index.vue',
7+
output: {
8+
path: path.resolve(__dirname, '../dist'),
9+
filename: 'vue2-dropzone.js',
10+
library: ['vue2-dropzone'],
11+
libraryTarget: 'umd'
12+
},
13+
devtool: false,
14+
plugins: [
15+
new webpack.DefinePlugin({
16+
'process.env': {
17+
NODE_ENV: '"production"'
18+
}
19+
}),
20+
new webpack.optimize.UglifyJsPlugin({
21+
compress: {
22+
warnings: false
23+
}
24+
}),
25+
new webpack.optimize.OccurenceOrderPlugin()
26+
]
27+
});

build/utils.js

-56
This file was deleted.

0 commit comments

Comments
 (0)