├── .babelrc
├── .eslintignore
├── .eslintrc.json
├── .gitignore
├── README.md
├── build
├── webpack.dev.config.js
└── webpack.prod.config.js
├── examples
├── App.vue
├── index.html
└── main.js
├── lib
└── .gitkeep
├── package.json
└── src
├── Datepicker.vue
├── assets
└── images
│ ├── arrow-left-white.svg
│ ├── arrow-right-white.svg
│ └── light-arrow-down.svg
└── index.js
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "es2015", "es2017"
4 | ],
5 | "plugins": [
6 | "transform-es2015-modules-commonjs"
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | node_modules/*
2 | build/*
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "env": {
4 | "browser": true,
5 | "commonjs": true,
6 | "es6": true,
7 | "node": true
8 | },
9 | "parserOptions": {
10 | "ecmaVersion": 8,
11 | "sourceType": "module"
12 | },
13 | "rules": {
14 | "no-const-assign": "warn",
15 | "no-this-before-super": "warn",
16 | "no-undef": "warn",
17 | "no-unreachable": "warn",
18 | "no-unused-vars": "warn",
19 | "constructor-super": "warn",
20 | "valid-typeof": "warn",
21 | "semi": [
22 | "warn",
23 | "never"
24 | ],
25 | "quotes": [
26 | "warn",
27 | "single"
28 | ],
29 | "arrow-parens": 0,
30 | "generator-star-spacing": 0,
31 | "space-before-function-paren": 0
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | dist
4 | lib/*
5 | !lib/.gitkeep
6 | .vscode
7 | npm-debug.log
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # vue-datepicker
2 |
3 | This is yet another vue datepicker component.
4 |
5 | ## Install
6 |
7 | Use npm to download code:
8 |
9 | ```
10 | npm install hsy-vue-datepicker -S
11 | ```
12 |
13 | then import it into your project, add below code into your `main.js`:
14 |
15 | ```js
16 | import Datepicker from 'hsy-vue-datepicker'
17 |
18 | Vue.use(Datepicker)
19 | ```
20 |
21 | ## Usage
22 |
23 | It supports single date mode, you just need to bind your date with `v-model`:
24 |
25 | ```html
26 |
27 |
90 |
--------------------------------------------------------------------------------
/build/webpack.dev.config.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var HtmlWebpackPlugin = require('html-webpack-plugin')
3 |
4 | module.exports = {
5 | entry: './examples/main.js',
6 | resolve: {
7 | extensions: ['.js', '.vue', '.json'],
8 | alias: {
9 | main: path.resolve(__dirname, '../src')
10 | },
11 | },
12 | output: {
13 | path: path.resolve(__dirname, '../dist/dev'),
14 | publicPath: '/',
15 | filename: 'index.js'
16 | },
17 | devServer: {
18 | contentBase: path.resolve(__dirname, '../dist/dev'),
19 | compress: false,
20 | port: 8080
21 | },
22 | plugins: [
23 | new HtmlWebpackPlugin({
24 | filename: path.resolve(__dirname, '../dist/dev/index.html'),
25 | template: 'examples/index.html',
26 | inject: true
27 | })
28 | ],
29 | module: {
30 | loaders: [{
31 | test: /\.vue$/,
32 | loader: 'vue-loader'
33 | }, {
34 | test: /\.js$/,
35 | loaders: ['babel-loader', 'eslint-loader'],
36 | exclude: /node_modules/
37 | }, {
38 | test: /\.css$/,
39 | loader: 'style-loader!css-loader'
40 | }, {
41 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
42 | loader: 'url-loader',
43 | query: {
44 | limit: 10000,
45 | name: 'img/[name].[hash:7].[ext]'
46 | }
47 | }, {
48 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
49 | loader: 'url-loader',
50 | query: {
51 | limit: 10000,
52 | name: 'fonts/[name].[hash:7].[ext]'
53 | }
54 | }]
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/build/webpack.prod.config.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 |
3 | module.exports = {
4 | entry: './src/index.js',
5 | devtool: 'source-map',
6 | resolve: {
7 | extensions: ['.js', '.vue', '.json']
8 | },
9 | output: {
10 | path: path.resolve(__dirname, '../lib'),
11 | filename: 'index.js',
12 | libraryTarget: 'commonjs2'
13 | },
14 | module: {
15 | loaders: [{
16 | test: /\.vue$/,
17 | loader: 'vue-loader'
18 | }, {
19 | test: /\.js$/,
20 | loaders: ['babel-loader', 'eslint-loader'],
21 | exclude: /node_modules/
22 | }, {
23 | test: /\.css$/,
24 | loader: 'style-loader!css-loader'
25 | }, {
26 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
27 | loader: 'url-loader',
28 | query: {
29 | limit: 10000,
30 | name: 'img/[name].[hash:7].[ext]'
31 | }
32 | }, {
33 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
34 | loader: 'url-loader',
35 | query: {
36 | limit: 10000,
37 | name: 'fonts/[name].[hash:7].[ext]'
38 | }
39 | }]
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/examples/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
18 | | {{ page.date.format && page.date.format('YYYY年 M月') }} | 19 |20 | | ||||
---|---|---|---|---|---|---|
日 | 23 |一 | 24 |二 | 25 |三 | 26 |四 | 27 |五 | 28 |六 | 29 |
34 | {{ date.date() }} 35 | | 36 |