Skip to content

Commit 0f5633d

Browse files
committed
Added GH pages deployment script for demo
1 parent e39e34e commit 0f5633d

File tree

8 files changed

+23
-9
lines changed

8 files changed

+23
-9
lines changed

demo/deploy.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
var ghpages = require('gh-pages');
2+
var path = require('path');
3+
4+
ghpages.publish('dist', function(err) {
5+
console.log('Github Pages deployment done.')
6+
7+
if (err) {
8+
console.log(err)
9+
}
10+
});

demo/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
</head>
88
<body>
99
<div id="app"></div>
10-
<script src="/dist/build.js"></script>
10+
<script src="./dist/build.js"></script>
1111
</body>
1212
</html>

demo/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
"cross-env": "^3.0.0",
1818
"css-loader": "^0.25.0",
1919
"file-loader": "^0.9.0",
20+
"gh-pages": "^1.0.0",
21+
"html-webpack-plugin": "^2.30.1",
2022
"install": "^0.10.1",
2123
"node-sass": "^4.5.0",
2224
"npm": "^5.4.2",

demo/src/App.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ export default {
7676
7777
methods: {
7878
click ({ items, index }) {
79-
let color = items.find(v => v.index === index)
80-
this.selected = color
79+
let value = items.find(v => v.index === index)
80+
this.selected = value.item
8181
8282
console.log(this.selected)
8383
},

demo/src/Icon.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
class="icon-delete-btn"
55
@mousedown="remove"></div>
66
<slot>
7-
{{index}}
87
</slot>
98
</div>
109
</template>
@@ -82,7 +81,7 @@ export default {
8281
box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.07);
8382
color: #777;
8483
85-
font-weight: 300;
84+
font-weight: 900;
8685
font-size: 12px;
8786
8887
line-height: 52px;

demo/webpack.config.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
var path = require('path')
22
var webpack = require('webpack')
3+
var HtmlWebpackPlugin = require('html-webpack-plugin')
34

45
module.exports = {
56
entry: './src/main.js',
67
output: {
78
path: path.resolve(__dirname, './dist'),
8-
publicPath: '/dist/',
9+
publicPath: './',
910
filename: 'build.js'
1011
},
1112
module: {
@@ -59,6 +60,9 @@ if (process.env.NODE_ENV === 'production') {
5960
}),
6061
new webpack.LoaderOptionsPlugin({
6162
minimize: true
63+
}),
64+
new HtmlWebpackPlugin({
65+
template: './index.html'
6266
})
6367
])
6468
}

dist/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,13 @@
265265
wrapEvent: function() {
266266
var other = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
267267
return _extends({
268+
datetime: Date.now(),
268269
items: this.getListClone()
269270
}, other);
270271
},
271272
getListClone: function() {
272273
return this.list.slice(0).sort(function(a, b) {
273274
return a.sort - b.sort;
274-
}).map(function(v) {
275-
return _extends({}, v.item);
276275
});
277276
},
278277
removeItem: function(_ref) {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-js-grid",
33
"description": "",
4-
"version": "1.0.0",
4+
"version": "1.0.0-rc1",
55
"author": "euvl <[email protected]>",
66
"private": false,
77
"scripts": {

0 commit comments

Comments
 (0)