-
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.
updated readme,fix the npm modules bugs
- Loading branch information
Showing
9 changed files
with
131 additions
and
85 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
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
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,81 @@ | ||
const webpack = require('webpack'); | ||
|
||
const path = require('path'); | ||
const fs = require('fs'); | ||
const srcFolder = path.join(__dirname, '../src', 'components'); | ||
const components = fs.readdirSync(srcFolder); | ||
const utils = require('./utils') | ||
const files = []; | ||
const entries = {}; | ||
components.forEach(component => { | ||
const name = component.split('.')[0]; | ||
if (name) { | ||
const file = `./src/components/${name}`; | ||
files.push(file); | ||
entries[name] = file; | ||
} | ||
}); | ||
|
||
module.exports = { | ||
entry: entries, | ||
output: { | ||
filename: '[name].js', | ||
path: './lib/components/', | ||
libraryTarget: 'commonjs2' | ||
}, | ||
externals(context, request, callback) { | ||
if (files.indexOf(request) > -1) { | ||
return callback(null, false); | ||
} | ||
return callback(null, true); | ||
}, | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.vue$/, | ||
loader: 'vue' | ||
}, { | ||
test: /\.js$/, | ||
loader: 'babel', | ||
include: path.join(__dirname, '../src'), | ||
exclude: /node_modules/ | ||
}, { | ||
test: /\.jsx$/, | ||
loader: 'jsx' | ||
}, { | ||
test: /\.json$/, | ||
loader: 'json' | ||
}, { | ||
test: /\.html$/, | ||
loader: 'vue-html' | ||
}, { | ||
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, | ||
loader: 'url', | ||
query: { | ||
limit: 10000, | ||
name: utils.assetsPath('img/[name].[hash:7].[ext]') | ||
} | ||
}, { | ||
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, | ||
loader: 'url', | ||
query: { | ||
limit: 10000, | ||
name: utils.assetsPath('fonts/[name].[hash:7].[ext]') | ||
} | ||
} | ||
] | ||
}, | ||
resolve: { | ||
extensions: ['', '.vue'] | ||
}, | ||
plugins: [ | ||
new webpack.optimize.UglifyJsPlugin({ | ||
compress: { | ||
warnings: false | ||
} | ||
}), | ||
new webpack.optimize.OccurenceOrderPlugin(), | ||
new webpack.DefinePlugin({'process.env.NODE_ENV': '"production"'}), | ||
new webpack.NoErrorsPlugin() | ||
] | ||
}; |
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
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 |
---|---|---|
@@ -1,46 +1,44 @@ | ||
<template lang="pug"> | ||
|
||
|
||
div(id="app") | ||
div | ||
time-picker | ||
|
||
|
||
</template> | ||
|
||
<script> | ||
import TimePicker from './components/TimePicker.vue' | ||
import TimePicker from './components/TimePicker' | ||
export default { | ||
components: { | ||
TimePicker | ||
}, | ||
components: { | ||
TimePicker | ||
}, | ||
} | ||
</script> | ||
|
||
<style> | ||
html { | ||
height: 100%; | ||
height: 100%; | ||
} | ||
body { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 100%; | ||
} | ||
#app { | ||
color: #2c3e50; | ||
margin-top: -100px; | ||
max-width: 600px; | ||
font-family: Source Sans Pro, Helvetica, sans-serif; | ||
text-align: center; | ||
color: #2c3e50; | ||
margin-top: -100px; | ||
max-width: 600px; | ||
font-family: Source Sans Pro, Helvetica, sans-serif; | ||
text-align: center; | ||
} | ||
#app a { | ||
color: #42b983; | ||
text-decoration: none; | ||
} | ||
.logo { | ||
width: 100px; | ||
height: 100px | ||
color: #42b983; | ||
text-decoration: none; | ||
} | ||
</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
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
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 |
---|---|---|
@@ -1,8 +1,3 @@ | ||
export const HOURS = new Array(24 + 1).join('0').split('') | ||
export const TWELVE_HOURS = new Array(12 + 1).join('0').split('') | ||
export const MINUTES = new Array(60 + 1).join('0').split('') | ||
|
||
export const PICKER_RADIUS = 130 | ||
export const MAX_ABSOLUTE_POSITION = 125 | ||
export const MIN_ABSOLUTE_POSITION = 90 | ||
export const POINTER_RADIUS = 15 | ||
module.exports.HOUR = new Array(24 + 1).join('0').split('') | ||
module.exports.TWELVE_HOURS = new Array(12 + 1).join('0').split('') | ||
module.exports.MINUTES = new Array(60 + 1).join('0').split('') |
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
import TimePicker from './components/TimePicker.vue' | ||
module.exports = TimePicker | ||
module.exports = require('./components/TimePicker.vue') |