├── app.asar ├── conf └── lang.json ├── src ├── bus.js ├── services │ ├── config.js │ ├── babel.js │ ├── gitignore.js │ ├── i18n.js │ ├── editorconfig.js │ ├── router.js │ ├── bus.js │ ├── app.js │ ├── index-html.js │ ├── template.js │ ├── write-file.js │ ├── util.js │ ├── vendors.js │ ├── eslint.js │ ├── index-vue.js │ ├── main.js │ ├── package.js │ └── webpack.js ├── app.js └── create.js ├── assets ├── github │ ├── 1.png │ ├── 2.png │ └── logo.png ├── img │ ├── iView.icns │ ├── iView.ico │ ├── iView.png │ ├── logo.png │ ├── iview-logo.png │ └── iview-name.png ├── css │ ├── fonts │ │ ├── ionicons.eot │ │ ├── ionicons.ttf │ │ └── ionicons.woff │ └── app.css ├── lang │ ├── zh.js │ └── en.js └── js │ ├── vue-i18n.min.js │ ├── vue-i18n.js │ └── vue.min.js ├── appdmg.json ├── gulpfile.js ├── .gitignore ├── README.md ├── LICENSE ├── app ├── about.html ├── index_prod.html ├── doc.html ├── index.html └── create.html ├── package.json └── main.js /app.asar: -------------------------------------------------------------------------------- 1 |  {"files":{}} -------------------------------------------------------------------------------- /conf/lang.json: -------------------------------------------------------------------------------- 1 | {"lang":"zh","message":"EN"} -------------------------------------------------------------------------------- /src/bus.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | export default new Vue(); -------------------------------------------------------------------------------- /assets/github/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iview/iview-cli/HEAD/assets/github/1.png -------------------------------------------------------------------------------- /assets/github/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iview/iview-cli/HEAD/assets/github/2.png -------------------------------------------------------------------------------- /assets/img/iView.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iview/iview-cli/HEAD/assets/img/iView.icns -------------------------------------------------------------------------------- /assets/img/iView.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iview/iview-cli/HEAD/assets/img/iView.ico -------------------------------------------------------------------------------- /assets/img/iView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iview/iview-cli/HEAD/assets/img/iView.png -------------------------------------------------------------------------------- /assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iview/iview-cli/HEAD/assets/img/logo.png -------------------------------------------------------------------------------- /assets/github/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iview/iview-cli/HEAD/assets/github/logo.png -------------------------------------------------------------------------------- /assets/img/iview-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iview/iview-cli/HEAD/assets/img/iview-logo.png -------------------------------------------------------------------------------- /assets/img/iview-name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iview/iview-cli/HEAD/assets/img/iview-name.png -------------------------------------------------------------------------------- /assets/css/fonts/ionicons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iview/iview-cli/HEAD/assets/css/fonts/ionicons.eot -------------------------------------------------------------------------------- /assets/css/fonts/ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iview/iview-cli/HEAD/assets/css/fonts/ionicons.ttf -------------------------------------------------------------------------------- /assets/css/fonts/ionicons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iview/iview-cli/HEAD/assets/css/fonts/ionicons.woff -------------------------------------------------------------------------------- /appdmg.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "iView", 3 | "icon": "assets/img/iView.icns", 4 | "background-color": "#eee", 5 | "contents": [ 6 | { "x": 448, "y": 200, "type": "link", "path": "/Applications" }, 7 | { "x": 192, "y": 200, "type": "file", "path": "iView-darwin-x64/iView.app" } 8 | ] 9 | } -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var electron = require('electron-connect').server.create(); 3 | 4 | gulp.task('watch:electron', function () { 5 | electron.start(); 6 | gulp.watch(['./*.js','./app/*.{html,js,css}','./src/*.js'], electron.restart); 7 | gulp.watch(['./app/*.{html,js,css}','./src/*.{html,js,css}'], electron.reload); 8 | }); -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .idea 3 | .ipr 4 | .iws 5 | *.diff 6 | *.patch 7 | *.bak 8 | .DS_Store 9 | node_modules/ 10 | .project 11 | .settings 12 | npm-debug.log 13 | .*proj 14 | .svn/ 15 | *.swp 16 | *.swo 17 | *.log 18 | test/dist/ 19 | dist/ 20 | iView-darwin-x64 21 | iView-win32-x64 22 | iView-win32-ia32 23 | iView-linux-x64 24 | iView-linux-ia32 -------------------------------------------------------------------------------- /src/services/config.js: -------------------------------------------------------------------------------- 1 | const writeFile = require('./write-file'); 2 | 3 | module.exports = function (opts) { 4 | const file = ` 5 | import Env from './env'; 6 | 7 | let config = { 8 | env: Env 9 | }; 10 | export default config; 11 | `; 12 | writeFile({ 13 | directory: `${opts.directory}/src/config`, 14 | fileName: 'config.js', 15 | data: file, 16 | success () { 17 | opts.success(); 18 | }, 19 | error () { 20 | opts.error(); 21 | } 22 | }); 23 | }; -------------------------------------------------------------------------------- /src/services/babel.js: -------------------------------------------------------------------------------- 1 | const writeFile = require('./write-file'); 2 | 3 | module.exports = function (opts) { 4 | const file = { 5 | "presets": [ 6 | ["es2015", { "modules": false }] 7 | ] 8 | }; 9 | writeFile({ 10 | directory: opts.directory, 11 | fileName: '.babelrc', 12 | data: JSON.stringify(file), 13 | codeFormat: { 14 | indent_size: 2 15 | }, 16 | success () { 17 | opts.success(); 18 | }, 19 | error () { 20 | opts.error(); 21 | } 22 | }); 23 | }; -------------------------------------------------------------------------------- /src/services/gitignore.js: -------------------------------------------------------------------------------- 1 | const writeFile = require('./write-file'); 2 | 3 | module.exports = function (opts) { 4 | const file = 5 | `.idea 6 | .idea/ 7 | .DS_Store 8 | node_modules/ 9 | .project 10 | dist 11 | dist/* 12 | src/config/*.tmp 13 | src/config/env.js 14 | npm-debug.log`; 15 | writeFile({ 16 | directory: opts.directory, 17 | fileName: '.gitignore', 18 | data: file, 19 | codeType: 'none', 20 | success () { 21 | opts.success(); 22 | }, 23 | error () { 24 | opts.error(); 25 | } 26 | }); 27 | }; -------------------------------------------------------------------------------- /src/services/i18n.js: -------------------------------------------------------------------------------- 1 | const writeFile = require('./write-file'); 2 | 3 | module.exports = function (opts) { 4 | const file = ` 5 | export default { 6 | 'zh-CN': { 7 | 8 | }, 9 | 'en-US': { 10 | 11 | } 12 | }; 13 | `; 14 | writeFile({ 15 | directory: `${opts.directory}/src`, 16 | fileName: 'locale.js', 17 | data: file, 18 | success () { 19 | opts.success(); 20 | }, 21 | error () { 22 | opts.error(); 23 | } 24 | }); 25 | }; -------------------------------------------------------------------------------- /src/services/editorconfig.js: -------------------------------------------------------------------------------- 1 | const writeFile = require('./write-file'); 2 | 3 | module.exports = function (opts) { 4 | const file = 5 | `root = true 6 | 7 | charset = utf-8 8 | indent_style = space 9 | indent_size = 4 10 | end_of_line = lf 11 | insert_final_newline = true 12 | trim_trailing_whitespace = true`; 13 | writeFile({ 14 | directory: opts.directory, 15 | fileName: '.editorconfig', 16 | data: file, 17 | codeType: 'none', 18 | success () { 19 | opts.success(); 20 | }, 21 | error () { 22 | opts.error(); 23 | } 24 | }); 25 | }; -------------------------------------------------------------------------------- /src/services/router.js: -------------------------------------------------------------------------------- 1 | const writeFile = require('./write-file'); 2 | 3 | module.exports = function (opts) { 4 | const file = ` 5 | const routers = [ 6 | { 7 | path: '/', 8 | meta: { 9 | title: '' 10 | }, 11 | component: (resolve) => require(['./views/index.vue'], resolve) 12 | } 13 | ]; 14 | export default routers; 15 | `; 16 | writeFile({ 17 | directory: `${opts.directory}/src`, 18 | fileName: 'router.js', 19 | data: file, 20 | success () { 21 | opts.success(); 22 | }, 23 | error () { 24 | opts.error(); 25 | } 26 | }); 27 | }; -------------------------------------------------------------------------------- /src/services/bus.js: -------------------------------------------------------------------------------- 1 | const writeFile = require('./write-file'); 2 | 3 | module.exports = function (opts) { 4 | const file = ` 5 | import Vue from 'vue'; 6 | export default new Vue({ 7 | data () { 8 | return { 9 | 10 | }; 11 | }, 12 | computed: { 13 | 14 | }, 15 | methods: { 16 | 17 | } 18 | }); 19 | `; 20 | writeFile({ 21 | directory: `${opts.directory}/src`, 22 | fileName: 'bus.js', 23 | data: file, 24 | success () { 25 | opts.success(); 26 | }, 27 | error () { 28 | opts.error(); 29 | } 30 | }); 31 | }; -------------------------------------------------------------------------------- /src/services/app.js: -------------------------------------------------------------------------------- 1 | const writeFile = require('./write-file'); 2 | 3 | module.exports = function (opts) { 4 | const file = ` 5 | 10 | 28 | `; 29 | writeFile({ 30 | directory: `${opts.directory}/src`, 31 | fileName: 'app.vue', 32 | data: file, 33 | codeType: 'html', 34 | success () { 35 | opts.success(); 36 | }, 37 | error () { 38 | opts.error(); 39 | } 40 | }); 41 | }; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | 4 | 5 |

6 | 7 | # iView-cli 8 | 9 | ### A visual CLI for scaffolding iView projects and offline doc of iView . 10 | 11 | ## Features 12 | 13 | - Visual 14 | - Configuring simply 15 | - Support both Mac and Windows 16 | - It is quite beautiful 17 | 18 | ## Screenshot 19 |

20 | 21 | 22 |

23 | 24 | ## [Download Released App](https://github.com/iview/iview-cli/releases) 25 | 26 | ## License 27 | [MIT](http://opensource.org/licenses/MIT) 28 | 29 | Copyright (c) 2016-present, TalkingData 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/services/index-html.js: -------------------------------------------------------------------------------- 1 | const writeFile = require('./write-file'); 2 | 3 | module.exports = function (opts) { 4 | const title = opts.data.name || 'iView project'; 5 | 6 | const file = ` 7 | 8 | 9 | 10 | iView project 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | `; 22 | writeFile({ 23 | directory: opts.directory, 24 | fileName: 'index.html', 25 | data: file, 26 | codeType: 'html', 27 | success () { 28 | opts.success(); 29 | }, 30 | error () { 31 | opts.error(); 32 | } 33 | }); 34 | }; -------------------------------------------------------------------------------- /src/services/template.js: -------------------------------------------------------------------------------- 1 | const writeFile = require('./write-file'); 2 | 3 | module.exports = function (opts) { 4 | const title = opts.data.name || 'iView project'; 5 | 6 | const file = ` 7 | 8 | 9 | 10 | iView project 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | `; 22 | writeFile({ 23 | directory: `${opts.directory}/src/template`, 24 | fileName: 'index.ejs', 25 | data: file, 26 | codeType: 'html', 27 | success () { 28 | opts.success(); 29 | }, 30 | error () { 31 | opts.error(); 32 | } 33 | }); 34 | }; -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 TalkingData 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/services/write-file.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const beauty = require('js-beautify').js_beautify; 3 | const beautyHtml = require('js-beautify').html; 4 | const beautyCss = require('js-beautify').css; 5 | 6 | module.exports = function (opts) { 7 | opts.codeFormat = opts.codeFormat || {}; 8 | opts.codeType = opts.codeType || 'js'; 9 | 10 | let data = ''; 11 | if (opts.codeType === 'html') { 12 | data = beautyHtml(opts.data, Object.assign({ 13 | 14 | }, opts.codeFormat)); 15 | } else if (opts.codeType === 'js') { 16 | data = beauty(opts.data, Object.assign({ 17 | indent_size: 4 18 | }, opts.codeFormat)); 19 | } else if (opts.codeType === 'css') { 20 | data = beautyCss(opts.data, Object.assign({ 21 | indent_size: 4 22 | }, opts.codeFormat)); 23 | } else if (opts.codeType === 'none') { 24 | data = opts.data; 25 | } 26 | 27 | if (!fs.existsSync(opts.directory)) { 28 | fs.mkdirSync(opts.directory); 29 | } 30 | 31 | fs.writeFile(`${opts.directory}/${opts.fileName}`, data, (err) => { 32 | if (err) { 33 | if (opts.error) opts.error(err); 34 | return false; 35 | } 36 | if (opts.success) opts.success(); 37 | }); 38 | }; -------------------------------------------------------------------------------- /app/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 关于 iView Cli 6 | 7 | 20 | 31 | 32 | 33 |
34 | 35 |

iView v2.7.3

36 | https://github.com/iview/iview-cli 37 |
38 | 39 | -------------------------------------------------------------------------------- /src/services/util.js: -------------------------------------------------------------------------------- 1 | const writeFile = require('./write-file'); 2 | 3 | module.exports = function (opts) { 4 | let ajax = ''; 5 | let ajaxSetting = ''; 6 | if (opts.data.ajax) { 7 | ajax = ` 8 | import axios from 'axios'; 9 | import env from '../config/env'; 10 | `; 11 | ajaxSetting = ` 12 | const ajaxUrl = env === 'development' ? 13 | 'http://127.0.0.1:8888' : 14 | env === 'production' ? 15 | 'https://www.url.com' : 16 | 'https://debug.url.com'; 17 | 18 | util.ajax = axios.create({ 19 | baseURL: ajaxUrl, 20 | timeout: 30000 21 | });`; 22 | } 23 | 24 | const file = ` 25 | ${ajax} 26 | let util = { 27 | 28 | }; 29 | util.title = function (title) { 30 | title = title ? title + ' - Home' : 'iView project'; 31 | window.document.title = title; 32 | }; 33 | ${ajaxSetting} 34 | 35 | export default util; 36 | `; 37 | writeFile({ 38 | directory: `${opts.directory}/src/libs`, 39 | fileName: 'util.js', 40 | data: file, 41 | success () { 42 | opts.success(); 43 | }, 44 | error () { 45 | opts.error(); 46 | } 47 | }); 48 | }; -------------------------------------------------------------------------------- /src/services/vendors.js: -------------------------------------------------------------------------------- 1 | const writeFile = require('./write-file'); 2 | 3 | module.exports = function (opts) { 4 | const ajax = opts.data.ajax ? "import axios from 'axios';" : ''; 5 | const vuex = opts.data.store.indexOf('vuex') > -1 ? "import Vuex from 'vuex';" : ''; 6 | const echarts = opts.data.chart.indexOf('echarts') > -1 ? "import echarts from 'echarts';" : ''; 7 | const cookies = opts.data.funs.indexOf('cookies') > -1 ? "import Cookies from 'js-cookie';" : ''; 8 | const clipboard = opts.data.funs.indexOf('clipboard') > -1 ? "import clipboard from 'clipboard';" : ''; 9 | const html2canvas = opts.data.funs.indexOf('html2canvas') > -1 ? "import html2canvas from 'html2canvas';" : ''; 10 | const rasterizehtml = opts.data.funs.indexOf('rasterizehtml') > -1 ? "import rasterizehtml from 'rasterizehtml';" : ''; 11 | 12 | const file = ` 13 | import Vue from 'vue'; 14 | import iView from 'iview'; 15 | import VueRouter from 'vue-router'; 16 | ${ajax} 17 | ${vuex} 18 | ${echarts} 19 | ${cookies} 20 | ${clipboard} 21 | ${html2canvas} 22 | ${rasterizehtml} 23 | `; 24 | writeFile({ 25 | directory: `${opts.directory}/src`, 26 | fileName: 'vendors.js', 27 | data: file, 28 | success () { 29 | opts.success(); 30 | }, 31 | error () { 32 | opts.error(); 33 | } 34 | }); 35 | }; -------------------------------------------------------------------------------- /src/services/eslint.js: -------------------------------------------------------------------------------- 1 | const writeFile = require('./write-file'); 2 | 3 | exports.createESLintRc = function (opts) { 4 | let file = ` 5 | { 6 | "root": true, 7 | "parserOptions": { 8 | "ecmaVersion": 6, 9 | "sourceType": "module" 10 | }, 11 | "env": { 12 | "browser": true 13 | }, 14 | "extends": "eslint:recommended", 15 | "plugins": [ "html" ], 16 | "rules": { 17 | "indent": ["error", 4, { "SwitchCase": 1 }], 18 | "quotes": ["error", "single"], 19 | "semi": ["error", "always"], 20 | "no-console": ["error"] 21 | } 22 | } 23 | `; 24 | writeFile({ 25 | directory: opts.directory, 26 | fileName: '.eslintrc.json', 27 | data: file, 28 | success () { 29 | opts.success(); 30 | }, 31 | error () { 32 | opts.error(); 33 | } 34 | }); 35 | }; 36 | 37 | exports.createESLintIgnore = function (opts) { 38 | let file = 39 | `src/router.js 40 | src/libs/util.js 41 | src/vendors.js`; 42 | writeFile({ 43 | directory: opts.directory, 44 | fileName: '.eslintignore', 45 | data: file, 46 | codeType: 'none', 47 | success () { 48 | opts.success(); 49 | }, 50 | error () { 51 | opts.error(); 52 | } 53 | }); 54 | }; -------------------------------------------------------------------------------- /app/index_prod.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | iView - A high quality UI Toolkit based on Vue.js 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/doc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | iView - A high quality UI Toolkit based on Vue.js 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/services/index-vue.js: -------------------------------------------------------------------------------- 1 | const writeFile = require('./write-file'); 2 | 3 | module.exports = function (opts) { 4 | const file = ` 5 | 31 | 46 | 58 | `; 59 | writeFile({ 60 | directory: `${opts.directory}/src/views`, 61 | fileName: 'index.vue', 62 | data: file, 63 | codeType: 'html', 64 | success () { 65 | opts.success(); 66 | }, 67 | error () { 68 | opts.error(); 69 | } 70 | }); 71 | }; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "iview-cli", 3 | "version": "2.1.0", 4 | "title": "iView Cli", 5 | "description": "Quick way to create an iView project.", 6 | "homepage": "http://www.iviewui.com", 7 | "keywords": [ 8 | "iview", 9 | "vue", 10 | "vue.js", 11 | "cli" 12 | ], 13 | "main": "main.js", 14 | "scripts": { 15 | "start": "electron main.js", 16 | "build:linux32": "electron-packager ./ iView --platform=linux --arch=ia32 ~/Desktop/iView --electronVersion=1.4.15 --overwrite --icon=./assets/img/iView.icns", 17 | "build:linux64": "electron-packager ./ iView --platform=linux --arch=x64 ~/Desktop/iView --electronVersion=1.4.15 --overwrite --icon=./assets/img/iView.icns", 18 | "build:mac": "electron-packager ./ iView --platform=darwin --arch=x64 ~/Desktop/iView --electronVersion=1.7.6 --overwrite --icon=./assets/img/iView.icns", 19 | "build:win32": "electron-packager ./ iView --platform=win32 --arch=ia32 ~/Desktop/iView --electronVersion=1.4.15 --overwrite --icon=./assets/img/iView.icns", 20 | "build:win64": "electron-packager ./ iView --platform=win32 --arch=x64 ~/Desktop/iView --electronVersion=1.4.15 --overwrite --icon=./assets/img/iView.icns", 21 | "appdmg": "appdmg appdmg.json ~/Desktop/iView.dmg" 22 | }, 23 | "repository": { 24 | "type": "git", 25 | "url": "https://github.com/iview/iview-cli" 26 | }, 27 | "author": "Aresn", 28 | "license": "MIT", 29 | "bugs": { 30 | "url": "https://github.com/iview/iview-cli/issues" 31 | }, 32 | "dependencies": { 33 | "ajv": "^5.2.2", 34 | "ajv-keywords": "^2.1.0", 35 | "axios": "^0.15.3", 36 | "electron-connect": "^0.6.2", 37 | "iview": "^2.4.0", 38 | "js-beautify": "^1.7.3", 39 | "vue": "^2.4.4", 40 | "vue-i18n": "^5.0.3" 41 | }, 42 | "devDependencies": { 43 | "electron": "^1.7.9", 44 | "electron-packager": "^8.7.2", 45 | "electron-prebuilt": "^1.4.13", 46 | "gulp": "^3.9.1", 47 | "vue-i18n": "^5.0.3" 48 | }, 49 | "update": { 50 | "version": 4, 51 | "mac": "http://git.oschina.net/icarusion/iviewcli/raw/master/iView-cli-2.0.0.dmg", 52 | "windows": "http://git.oschina.net/icarusion/iviewcli/raw/master/iView-cli-2.0.0-win32-x64.zip", 53 | "desc": "
  • 全面升级至2.0
  • " 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | iView 7 | 8 | 9 | 10 | 11 |
    12 |
    13 |
    14 |
    15 | {{ language.message }} 16 |
    17 | 18 | 19 | 20 |
    21 |
    {{ $t("message.intro") }}
    22 | 23 | 24 | {{ $t("message.newProject") }} 25 | 26 | 27 | {{ $t("message.docOffline") }} 28 | 29 | 30 |
    31 |
    32 |
    33 | {{ $t("message.iviewVersion") }}:{{ iviewVersion }}检查更新 34 |
    35 |
    36 | 43 |

    $t('message.updatedContent'):

    44 | 45 |
    46 |
    47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /assets/lang/zh.js: -------------------------------------------------------------------------------- 1 | exports.zhLang = { 2 | newProject: '新建工程', 3 | intro: '高效、卓越的整套前端解决方案', 4 | docOffline: '离线文档', 5 | iviewVersion: '当前文档版本', 6 | newVersion: '发现新版本', 7 | download: '下载', 8 | updatedContent: '更新内容', 9 | checkingUpdates: '正在检查更新', 10 | checkUpdate: '检查更新', 11 | isLatestVersion: '当前已是最新版本', 12 | ok: '确定', 13 | creating: '创建中', 14 | createDone: '创建完成', 15 | creatingError: '创建失败', 16 | moreConf: '进一步配置', 17 | version: '版本', 18 | pretreatment: '预处理', 19 | multilingual: '多语言', 20 | basedOn: '基于', 21 | stateManagement: '状态管理', 22 | charts: '图表', 23 | others: '附加功能', 24 | copy: '复制', 25 | html2canvas: 'HTML转图片', 26 | rasterizeHtml: 'HTML转图片', 27 | showMoreConf: '显示更多配置', 28 | projectName: '项目名称', 29 | versionUpercase: '版本', 30 | projectNamePlaceholder: '只能输入英文且不能有空格', 31 | versionPlaceholder: '请输入版本号,像这样 1.0.0', 32 | projectIntro: '项目介绍', 33 | projectIntroPlaceholder: '请输入项目介绍', 34 | link: '地址', 35 | gitLinkPlaceholder: '请输入项目所在仓库地址', 36 | createProject: '创建工程', 37 | reset: '重置', 38 | create: '创建', 39 | basicConfFile: '基础配置文件', 40 | devConfFile: '开发环境配置文件', 41 | proConfFile: '生产环境配置文件', 42 | routerConfFile: '路由配置文件', 43 | multilingualConfFile: '多语言配置文件', 44 | routerMountRootComponent: '路由挂载根组件', 45 | indexTemplate: '首页模版', 46 | index: '首页', 47 | indexComponent: '首页组件', 48 | mainFile: '入口文件', 49 | confFile: '配置文件', 50 | toolsetFile: '工具集文件', 51 | centralEventBusFile: '中央事件总线文件', 52 | ignoreFile: '忽略文件', 53 | furtherConf: '进一步配置', 54 | openDirectory: '打开目录', 55 | hasSaveAt: '已将所有配置文件保存在指定的', 56 | directory: '目录', 57 | whatToDoNext: '按照下面的流程可以启动项目。对于一些定制内容,可以进一步配置。', 58 | installSomeToolsFirst: '请预先安装Node.js、npm 和 webpack', 59 | installDependencies: '安装依赖', 60 | startService: '启动服务(开发环境)', 61 | openWebsiteLeftText: '服务启动后,打开', 62 | openWebsiteRightText: '访问网站', 63 | compileAndPackage: '编译打包(生产环境)', 64 | config: '配置', 65 | axiosLeftText: '使用', 66 | axiosMiddleText: '完成Ajax请求,并且将其封装在了', 67 | axiosRightText: '里,点击文件修改具体配置。', 68 | modifyHtmlTemplate: '修改 HTML 模版', 69 | modifyIndexLeftText: '修改', 70 | modifyIndexRightText: '文件,使用webpack重新编译,可以改变入口html。', 71 | multiLanguageConfLeftText: '已预先将多语言配置写入', 72 | multiLanguageConfMiddleText: '文件,并支持中文和英文,可在', 73 | multiLanguageConfRightText: '里配置。', 74 | useESLint: '使用ESLint来检测代码是否符合规范', 75 | backHome: '返回首页', 76 | selectDir: '选择工程保存目录', 77 | about: '关于', 78 | } -------------------------------------------------------------------------------- /assets/css/app.css: -------------------------------------------------------------------------------- 1 | body{ 2 | width: 100%; 3 | height: 100%; 4 | overflow: hidden; 5 | -webkit-user-select: none; 6 | user-select: none; 7 | } 8 | [v-cloak]{ 9 | display: none; 10 | } 11 | .title{ 12 | height: 20px; 13 | text-align: center; 14 | -webkit-app-region: drag; 15 | padding: 4px 0 0; 16 | font-size: 14px; 17 | } 18 | .subtitle{ 19 | padding: 15px; 20 | font-size: 14px; 21 | } 22 | .home-app{ 23 | width: 100%; 24 | position: absolute; 25 | top: 0; 26 | bottom: 0; 27 | left: 0; 28 | text-align: center; 29 | } 30 | .home-row{ 31 | height: 100%; 32 | } 33 | .home-logo, .home-name{ 34 | width: 90px; 35 | height: 90px; 36 | margin: 0 auto; 37 | background-image: url("../img/iview-logo.png"); 38 | background-repeat: no-repeat; 39 | background-size: cover; 40 | } 41 | .home-name{ 42 | height: 40px; 43 | background-image: url("../img/iview-name.png"); 44 | } 45 | .home-desc{ 46 | margin: 20px 0 20px; 47 | font-size: 14px; 48 | } 49 | .home-menu{ 50 | margin: 35px 0 150px; 51 | } 52 | .home-version{ 53 | position: fixed; 54 | bottom: 15px; 55 | left: 0; 56 | right: 0; 57 | text-align: center; 58 | } 59 | 60 | .create-app{ 61 | position: absolute; 62 | top: 40px; 63 | bottom: 15px; 64 | left: 0; 65 | right: 0; 66 | z-index: 1; 67 | overflow: auto; 68 | } 69 | .create-form{ 70 | margin-right: 15px; 71 | } 72 | .create-app .ivu-form-item{ 73 | margin-bottom: 10px; 74 | } 75 | .create-app-more{ 76 | display: block; 77 | margin: 0 auto 16px; 78 | text-align: center; 79 | } 80 | .create-app-more-item{ 81 | margin-bottom: 30px; 82 | } 83 | .create-app-submit{ 84 | width: 80%; 85 | margin: 0 auto; 86 | } 87 | 88 | .create-info li{ 89 | list-style: none; 90 | margin: 5px 0 0 15px; 91 | } 92 | .create-info li i{ 93 | position: relative; 94 | top: 1px; 95 | } 96 | .create-info-submit{ 97 | margin: 15px auto 0; 98 | } 99 | 100 | .create-next{ 101 | padding: 15px; 102 | } 103 | .create-next h4{ 104 | margin-bottom: 2px; 105 | } 106 | .create-next code{ 107 | display: block; 108 | padding: 8px; 109 | margin: 10px 0 8px; 110 | border-radius: 4px; 111 | background: #f7f7f7; 112 | color: #525252; 113 | } 114 | .create-next p{ 115 | padding: 2px 8px; 116 | } 117 | 118 | .lang-setting-con{ 119 | width: 50px; 120 | position: absolute; 121 | right: 10px; 122 | top: 10px; 123 | text-align: center; 124 | } 125 | .lang-setting-con button{ 126 | text-align: center; 127 | } -------------------------------------------------------------------------------- /src/services/main.js: -------------------------------------------------------------------------------- 1 | const writeFile = require('./write-file'); 2 | 3 | module.exports = function (opts) { 4 | let i18n = ''; 5 | let i18nUse = ''; 6 | let i18nAuto = ''; 7 | if (opts.data.i18n) { 8 | i18n = ` 9 | import VueI18n from 'vue-i18n'; 10 | import Locales from './locale'; 11 | import zhLocale from 'iview/src/locale/lang/zh-CN'; 12 | import enLocale from 'iview/src/locale/lang/en-US';`; 13 | i18nUse = `Vue.use(VueI18n);`; 14 | i18nAuto = ` 15 | // 自动设置语言 16 | const navLang = navigator.language; 17 | const localLang = (navLang === 'zh-CN' || navLang === 'en-US') ? navLang : false; 18 | const lang = window.localStorage.getItem('language') || localLang || 'zh-CN'; 19 | 20 | Vue.config.lang = lang; 21 | 22 | // 多语言配置 23 | const locales = Locales; 24 | const mergeZH = Object.assign(zhLocale, locales['zh-CN']); 25 | const mergeEN = Object.assign(enLocale, locales['en-US']); 26 | Vue.locale('zh-CN', mergeZH); 27 | Vue.locale('en-US', mergeEN);`; 28 | } 29 | 30 | let vuex = ''; 31 | let vuexUse = ''; 32 | let store = ''; 33 | let storeSet = ''; 34 | 35 | if (opts.data.store.indexOf('vuex') > -1) { 36 | vuex = "import Vuex from 'vuex';"; 37 | vuexUse = 'Vue.use(Vuex);'; 38 | store = ` 39 | const store = new Vuex.Store({ 40 | state: { 41 | 42 | }, 43 | getters: { 44 | 45 | }, 46 | mutations: { 47 | 48 | }, 49 | actions: { 50 | 51 | } 52 | }); 53 | `; 54 | storeSet = 'store: store,'; 55 | } 56 | 57 | const file = ` 58 | import Vue from 'vue'; 59 | import iView from 'iview'; 60 | import VueRouter from 'vue-router'; 61 | import Routers from './router'; 62 | ${vuex} 63 | import Util from './libs/util'; 64 | import App from './app.vue'; 65 | import 'iview/dist/styles/iview.css'; 66 | ${i18n} 67 | 68 | Vue.use(VueRouter); 69 | ${vuexUse} 70 | ${i18nUse} 71 | Vue.use(iView); 72 | ${i18nAuto} 73 | 74 | 75 | // 路由配置 76 | const RouterConfig = { 77 | mode: 'history', 78 | routes: Routers 79 | }; 80 | const router = new VueRouter(RouterConfig); 81 | 82 | router.beforeEach((to, from, next) => { 83 | iView.LoadingBar.start(); 84 | Util.title(to.meta.title); 85 | next(); 86 | }); 87 | 88 | router.afterEach(() => { 89 | iView.LoadingBar.finish(); 90 | window.scrollTo(0, 0); 91 | }); 92 | 93 | ${store} 94 | 95 | new Vue({ 96 | el: '#app', 97 | router: router,${storeSet} 98 | render: h => h(App) 99 | }); 100 | `; 101 | writeFile({ 102 | directory: `${opts.directory}/src`, 103 | fileName: 'main.js', 104 | data: file, 105 | success () { 106 | opts.success(); 107 | }, 108 | error () { 109 | opts.error(); 110 | } 111 | }); 112 | }; -------------------------------------------------------------------------------- /assets/lang/en.js: -------------------------------------------------------------------------------- 1 | exports.enLang = { 2 | newProject: 'New Project', 3 | intro: 'Efficient, excellent set of front-end solutions', 4 | docOffline: 'Document', 5 | iviewVersion: 'Document version', 6 | newVersion: 'Discover the new version', 7 | download: 'Download', 8 | updatedContent: 'Updated content', 9 | checkingUpdates: 'Checking for updates', 10 | checkUpdate: 'Check for updates', 11 | isLatestVersion: "It's the latest version", 12 | ok: "ok", 13 | creating: 'Creating', 14 | createDone: 'CreateDone', 15 | creatingError: 'CreatingError', 16 | moreConf: 'More configuration', 17 | version: 'version', 18 | pretreatment: '', 19 | multilingual: 'i18n', 20 | basedOn: 'Based on', 21 | stateManagement: 'State', 22 | charts: 'Charts', 23 | others: 'Others', 24 | copy: 'Copy', 25 | html2canvas: 'HTML to picture', 26 | rasterizeHtml: 'HTML to picture', 27 | showMoreConf: 'Show more configuration', 28 | projectName: 'Name', 29 | versionUpercase: 'Version', 30 | projectNamePlaceholder: "English only widthout spaces", 31 | versionPlaceholder: "Enter version like '1.0.0'", 32 | projectIntro: "Introduction", 33 | projectIntroPlaceholder: 'Enter project introduction', 34 | link: 'link', 35 | gitLinkPlaceholder: 'Enter the link to the project', 36 | createProject: 'Create Project', 37 | reset: 'Reset', 38 | create: 'Create', 39 | basicConfFile: 'basic config file', 40 | devConfFile: 'development environment config file', 41 | proConfFile: 'production environment config file', 42 | routerConfFile: 'router config file', 43 | multilingualConfFile: 'i18n config file', 44 | routerMountRootComponent: 'router mount the root component', 45 | indexTemplate: 'index template', 46 | index: 'index', 47 | indexComponent: 'index component', 48 | mainFile: 'main file', 49 | confFile: 'config file', 50 | toolsetFile: 'toolset File', 51 | centralEventBusFile: 'Central event bus file', 52 | ignoreFile: 'Ignore File', 53 | furtherConf: 'Further Config', 54 | openDirectory: 'Open Dir', 55 | hasSaveAt: 'has saved all the config files in the specified', 56 | directory: 'directory', 57 | whatToDoNext: 'Follow the procedure below to start the project. For some custom content, you can further configure.', 58 | installSomeToolsFirst: 'Please install the Node.js,npm and webpack globally first.', 59 | installDependencies: 'Install Dependencies', 60 | startService: 'Start Service(Development environment)', 61 | openWebsiteLeftText: 'Use', 62 | openWebsiteRightText: 'to access the website, after the service starts.', 63 | compileAndPackage: 'Compile and Package(Development environment)', 64 | config: 'Configure', 65 | axiosLeftText: 'uses', 66 | axiosMiddleText: "to complete Ajax request, and it's packaged in the", 67 | axiosRightText: ', click on the file to modify the specific configuration.', 68 | modifyHtmlTemplate: 'Modify HTML template', 69 | modifyIndexLeftText: 'You can change the entry html, after modifying the file ', 70 | modifyIndexRightText: ' and recompiling use webpack.', 71 | multiLanguageConfLeftText: 'has written multi-language configuration in the file ', 72 | multiLanguageConfMiddleText: 'it default support Chinese and English, you can configure it in the file', 73 | multiLanguageConfRightText: '.', 74 | useESLint: 'Use ESLint to detect whether the code conforms to the specification', 75 | backHome: 'Home', 76 | selectDir: 'Select the directory where to save the project', 77 | about: 'About', 78 | 79 | } -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | const { app, BrowserWindow, Menu } = require('electron'); 2 | const path = require('path'); 3 | const url = require('url'); 4 | const fs = require('fs'); 5 | 6 | let logo = path.join(__dirname, 'assets/img/logo.png'); 7 | let win = null; 8 | let win_about = null; 9 | 10 | let willClose = false; 11 | 12 | function createWindow () { 13 | win = new BrowserWindow({ 14 | width: 360, 15 | // width: 1000, 16 | height: 572, 17 | // height: 700, 18 | title: 'iView', 19 | // y:200, 20 | // x:20, 21 | center: true, 22 | resizable: false, 23 | icon: logo, 24 | titleBarStyle: 'hidden' 25 | }); 26 | 27 | win.loadURL(url.format({ 28 | pathname: path.join(__dirname, 'app/index.html'), 29 | protocol: 'file:', 30 | slashes: true 31 | })); 32 | 33 | // 打开开发者工具。 34 | // win.webContents.openDevTools(); 35 | 36 | // 当 window 被关闭,这个事件会被触发。 37 | win.on('close', (event) => { 38 | if (process.platform !== 'win32' && !willClose) { 39 | win.hide(); 40 | event.preventDefault(); 41 | } 42 | }); 43 | win.on('closed', () => { 44 | win = null; 45 | }); 46 | } 47 | 48 | function createMenu (language) { 49 | const template = [ 50 | { 51 | label: app.getName(), 52 | submenu: [ 53 | { 54 | label: (language.lang==="zh"? "关于": "about")+' iView Cli', 55 | click () { 56 | if (win_about == null) { 57 | win_about = new BrowserWindow({ 58 | width: 300, 59 | height: 180, 60 | title: (language.lang==="zh"? "关于": "about")+' iView', 61 | center: true, 62 | resizable: false, 63 | icon: logo, 64 | minimizable: false, 65 | maximizable: false 66 | }); 67 | 68 | win_about.loadURL(url.format({ 69 | pathname: path.join(__dirname, 'app/about.html'), 70 | protocol: 'file:', 71 | slashes: true 72 | })); 73 | 74 | win_about.on('closed', (e) => { 75 | win_about = null; 76 | }); 77 | } 78 | } 79 | }, 80 | { 81 | role: 'quit', 82 | label: (language.lang==="zh"? "退出": "Quit") 83 | } 84 | ] 85 | } 86 | ]; 87 | const menu = Menu.buildFromTemplate(template); 88 | Menu.setApplicationMenu(menu); 89 | } 90 | 91 | app.on('ready', () => { 92 | let _path = path.join(__dirname, './conf/lang.json'); 93 | let data = fs.readFileSync(_path); 94 | let language = data?JSON.parse(data):{ lang: 'zh', message: 'EN' }; 95 | createWindow(); 96 | createMenu(language); 97 | }); 98 | 99 | app.on('activate', () => { 100 | if (win == null) { 101 | createWindow(); 102 | } else { 103 | win.show(); 104 | } 105 | }); 106 | app.on('before-quit', function () { 107 | willClose = true; 108 | }); 109 | app.on('window-all-closed', function () { 110 | if (process.platform !== 'darwin') { 111 | app.quit(); 112 | } 113 | }); -------------------------------------------------------------------------------- /src/app.js: -------------------------------------------------------------------------------- 1 | const electron = require('electron'); 2 | const remote = electron.remote; 3 | const BrowserWindow = remote.BrowserWindow; 4 | const win = BrowserWindow.getAllWindows()[0]; 5 | const ipcMain = electron.ipcMain; 6 | 7 | const axios = require('axios'); 8 | const shell = electron.shell; 9 | 10 | const zhLang = require('../assets/lang/zh').zhLang; 11 | const enLang = require('../assets/lang/en').enLang; 12 | const i18n = require('vue-i18n'); 13 | let locales = { 14 | en: { 15 | message: enLang 16 | }, 17 | zh: { 18 | message: zhLang 19 | } 20 | } 21 | 22 | const fs = require('fs'); 23 | const path = require('path'); 24 | let _path = path.join(__dirname, '../conf/lang.json'); 25 | let getLang = fs.readFileSync(_path); 26 | let language = getLang?JSON.parse(getLang):{ lang: 'zh', message: 'EN' }; 27 | Vue.config.lang = language.lang; 28 | 29 | 30 | Object.keys(locales).forEach(function(lang){ 31 | Vue.locale(lang, locales[lang]) 32 | }) 33 | 34 | const app = new Vue({ 35 | el: '#app', 36 | data: { 37 | isHidden: false, 38 | version: 4, 39 | update: {}, 40 | showUpdate: false, 41 | language: language, 42 | iviewVersion: 0 43 | }, 44 | methods: { 45 | handleCreateApp () { 46 | window.location.href = 'create.html'; 47 | }, 48 | handleOpenDoc () { 49 | this.isHidden = true; 50 | setTimeout(() => { 51 | window.location.href = 'doc.html'; 52 | win.setResizable(true); 53 | win.maximize(); 54 | }, 100); 55 | }, 56 | // 检查更新 57 | checkUpdate (constraint = false) { 58 | let msg = null; 59 | if (constraint) { 60 | msg = this.$Message.loading( app.$t('message.checkingUpdates') + '...', 0); 61 | } 62 | axios.get('https://raw.githubusercontent.com/iview/iview-cli/master/package.json?' + Date.parse(new Date())) 63 | .then((response) => { 64 | const data = response.data; 65 | if (data.update.version > this.version) { 66 | msg(); 67 | this.update = data.update; 68 | this.showUpdate = true; 69 | } else { 70 | if (constraint) { 71 | setTimeout(() => { 72 | msg(); 73 | this.$Modal.info({ 74 | title: app.$t('message.checkUpdate'), 75 | content: app.$t('message.isLatestVersion'), 76 | okText: app.$t('message.ok') 77 | }) 78 | }, 2000); 79 | } 80 | } 81 | }) 82 | }, 83 | handleOk () { 84 | if (process.platform === 'darwin') { 85 | shell.openExternal(this.update.mac); 86 | } else { 87 | shell.openExternal(this.update.windows); 88 | } 89 | }, 90 | handleCancel () { 91 | 92 | }, 93 | changeLauage () { 94 | Vue.config.lang = this.language.lang === 'zh'? 'en': 'zh'; 95 | this.language = this.language.lang === 'zh'? { lang: "en", message: "中文" }: { lang: "zh", message: "EN" }; 96 | fs.writeFile(_path, JSON.stringify(app.language), function(err){}) 97 | } 98 | }, 99 | mounted () { 100 | axios.get('https://api.github.com/repos/iview/iview/releases/latest').then(res => { 101 | this.iviewVersion = res.data.tag_name.substr(1); 102 | }) 103 | this.checkUpdate(); 104 | } 105 | }); 106 | -------------------------------------------------------------------------------- /src/services/package.js: -------------------------------------------------------------------------------- 1 | const writeFile = require('./write-file'); 2 | 3 | let file = { 4 | "name": "", 5 | "version": "1.0.0", 6 | "description": "", 7 | "main": "index.js", 8 | "scripts": { 9 | "init": "webpack --progress --config webpack.dev.config.js", 10 | "dev": "webpack-dev-server --content-base ./ --open --inline --hot --compress --history-api-fallback --config webpack.dev.config.js", 11 | "build": "webpack --progress --hide-modules --config webpack.prod.config.js", 12 | "lint": "eslint --fix --ext .js,.vue src" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "" 17 | }, 18 | "author": "", 19 | "license": "MIT", 20 | "dependencies": { 21 | "axios": "^0.17.1", 22 | "iview": "^2.7.4", 23 | "vue": "^2.5.2", 24 | "vue-router": "^3.0.1" 25 | }, 26 | "devDependencies": { 27 | "autoprefixer-loader": "^3.2.0", 28 | "babel": "^6.23.0", 29 | "babel-core": "^6.23.1", 30 | "babel-loader": "^7.1.2", 31 | "babel-plugin-transform-runtime": "^6.12.0", 32 | "babel-preset-es2015": "^6.9.0", 33 | "babel-runtime": "^6.11.6", 34 | "css-loader": "^0.28.7", 35 | "eslint": "^4.13.1", 36 | "eslint-plugin-html": "^4.0.1", 37 | "extract-text-webpack-plugin": "^3.0.2", 38 | "file-loader": "^1.1.5", 39 | "html-loader": "^0.5.1", 40 | "html-webpack-plugin": "^2.28.0", 41 | "iview-loader": "^1.0.0", 42 | "less": "^2.7.3", 43 | "less-loader": "^4.0.5", 44 | "style-loader": "^0.19.1", 45 | "url-loader": "^0.6.2", 46 | "vue-hot-reload-api": "^2.2.4", 47 | "vue-html-loader": "^1.2.3", 48 | "vue-loader": "^13.5.0", 49 | "vue-style-loader": "^3.0.3", 50 | "vue-template-compiler": "^2.2.1", 51 | "webpack": "^3.8.1", 52 | "webpack-dev-server": "^2.9.2", 53 | "webpack-merge": "^4.1.1" 54 | } 55 | }; 56 | 57 | module.exports = function (opts) { 58 | const data = opts.data; 59 | 60 | if (data.name) file.name = data.name; 61 | if (data.version) file.version = data.version; 62 | if (data.desc) file.description = data.desc; 63 | if (data.git) file.repository.url = data.git; 64 | 65 | if (data.css.indexOf('less') > -1) { 66 | file.devDependencies['less'] = '^2.7.1'; 67 | file.devDependencies['less-loader'] = '^2.2.3'; 68 | } 69 | 70 | if (data.css.indexOf('sass') > -1) { 71 | file.devDependencies['node-sass'] = '^3.10.1'; 72 | file.devDependencies['sass-loader'] = '^4.0.2'; 73 | } 74 | 75 | if (data.ajax) file.dependencies['axios'] = '^0.15.3'; 76 | if (data.i18n) file.dependencies['vue-i18n'] = '^5.0.3'; 77 | if (data.store.indexOf('vuex') > -1) file.dependencies['vuex'] = '^2.2.1'; 78 | if (data.chart.indexOf('echarts') > -1) file.dependencies['echarts'] = '^3.4.0'; 79 | if (data.eslint) { 80 | file.devDependencies['eslint'] = '^3.12.2'; 81 | file.devDependencies['eslint-plugin-html'] = '^1.7.0'; 82 | } 83 | 84 | if (data.funs.indexOf('cookies') > -1) file.dependencies['js-cookie'] = '^2.1.3'; 85 | if (data.funs.indexOf('clipboard') > -1) file.dependencies['clipboard'] = '^1.5.12'; 86 | if (data.funs.indexOf('html2canvas') > -1) file.dependencies['html2canvas'] = '^0.5.0-beta4'; 87 | if (data.funs.indexOf('rasterizehtml') > -1) file.dependencies['rasterizehtml'] = '^1.2.4'; 88 | 89 | writeFile({ 90 | directory: opts.directory, 91 | fileName: 'package.json', 92 | data: JSON.stringify(file), 93 | codeFormat: { 94 | indent_size: 2 95 | }, 96 | success () { 97 | opts.success(); 98 | }, 99 | error () { 100 | opts.error(); 101 | } 102 | }); 103 | }; -------------------------------------------------------------------------------- /assets/js/vue-i18n.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * vue-i18n v5.0.3 3 | * (c) 2017 kazuya kawaguchi 4 | * Released under the MIT License. 5 | */ 6 | !function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.VueI18n=t()}(this,function(){"use strict";function n(n,t){window.console&&(console.warn("[vue-i18n] "+n),t&&console.warn(t.stack))}function t(n,t,r){if("object"==typeof t)r(t);else{var o=t.call(this);if("function"==typeof o)if(o.resolved)r(o.resolved);else if(o.requested)o.pendingCallbacks.push(r);else{o.requested=!0;var i=o.pendingCallbacks=[r];o(function(n){o.resolved=n;for(var t=0,e=i.length;t1?n.apply(t,arguments):n.call(t,e):n.call(t)}return e._length=n.length,e}function u(n){return null!==n&&"object"==typeof n}function l(n){return j.call(n)===A}function c(n,t){return O.call(n,t)}function f(n){return K.test(n)}function s(n){var t=n.charCodeAt(0),e=n.charCodeAt(n.length-1);return t!==e||34!==t&&39!==t?n:n.slice(1,-1)}function p(n){if(void 0===n)return"eof";var t=n.charCodeAt(0);switch(t){case 91:case 93:case 46:case 34:case 39:case 48:return n;case 95:case 36:case 45:return"ident";case 32:case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return t>=97&&t<=122||t>=65&&t<=90?"ident":t>=49&&t<=57?"number":"else"}function g(n){var t=n.trim();return("0"!==n.charAt(0)||!isNaN(n))&&(f(t)?s(t):"*"+t)}function d(n){function t(){var t=n[f+1];if(s===Z&&"'"===t||s===B&&'"'===t)return f++,r="\\"+t,v[F](),!0}var e,r,o,i,a,u,l,c=[],f=-1,s=z,d=0,v=[];for(v[H]=function(){void 0!==o&&(c.push(o),o=void 0)},v[F]=function(){void 0===o?o=r:o+=r},v[N]=function(){v[F](),d++},v[q]=function(){if(d>0)d--,s=S,v[F]();else{if(d=0,o=g(o),o===!1)return!1;v[H]()}};null!=s;)if(f++,e=n[f],"\\"!==e||!t()){if(i=p(e),l=G[s],a=l[i]||l.else||E,a===E)return;if(s=a[0],u=v[a[1]],u&&(r=a[2],r=void 0===r?e:r,u()===!1))return;if(s===D)return c.raw=n,c}}function v(n){var t=V[n];return t||(t=d(n),t&&(V[n]=t)),t}function h(n,t){void 0===t&&(t={});var e=(n.version&&Number(n.version.split(".")[0])||-1,"en");y(n,e),m(n,J),$(n,J),C(n,J,e),R(n)}function y(n,t){var e=n.config.silent;n.config.silent=!0,J||(J=new n({data:{lang:t,locales:{}}})),n.config.silent=e}var b,_,w,m=function(e,r){e.locale=function(e,o,i){return void 0===o?r.locales[e]:void(null===o?(r.locales[e]=void 0,delete r.locales[e]):t(e,o,function(t){t?r.$set(r.locales,e,t):n("failed set `"+e+"` locale"),i&&i()}))}},$=function(n,t){var e=n.prototype._init;n.prototype._init=function(n){var r=this;e.call(this,n),this.$parent||(this._$lang=t,this._langUnwatch=this._$lang.$watch("$data",function(n,t){r.$forceUpdate()},{deep:!0}))};var r=n.prototype._destroy;n.prototype._destroy=function(){!this.$parent&&this._langUnwatch&&(this._langUnwatch(),this._langUnwatch=null,this._$lang=null),r.apply(this,arguments)}},j=Object.prototype.toString,A="[object Object]",O=Object.prototype.hasOwnProperty,k=null,P=null,C=function(n,t,e){function i(n,t){var e=new u(t,n,null,{lazy:!0});return function(){return e.dirty&&e.evaluate(),l&&l.target&&e.depend(),e.value}}var u=r(t),l=o(t);Object.defineProperty(n.config,"lang",{enumerable:!0,configurable:!0,get:i(function(){return t.lang},t),set:a(function(n){t.lang=n},t)}),w=e,Object.defineProperty(n.config,"fallbackLang",{enumerable:!0,configurable:!0,get:function(){return w},set:function(n){w=n}}),Object.defineProperty(n.config,"missingHandler",{enumerable:!0,configurable:!0,get:function(){return k},set:function(n){k=n}}),Object.defineProperty(n.config,"i18nFormatter",{enumerable:!0,configurable:!0,get:function(){return P},set:function(n){P=n}})},U=/(%|)\{([0-9a-zA-Z_]+)\}/g,x=function(n){function t(n){for(var t=[],e=arguments.length-1;e-- >0;)t[e]=arguments[e+1];return t=1===t.length&&"object"==typeof t[0]?t[0]:{},t&&t.hasOwnProperty||(t={}),n.replace(U,function(e,r,o,a){var u;return"{"===n[a-1]&&"}"===n[a+e.length]?o:(u=c(t,o)?t[o]:e,i(u)?"":u)})}return t},V=Object.create(null),F=0,H=1,N=2,q=3,z=0,L=1,M=2,I=3,S=4,Z=5,B=6,D=7,E=8,G=[];G[z]={ws:[z],ident:[I,F],"[":[S],eof:[D]},G[L]={ws:[L],".":[M],"[":[S],eof:[D]},G[M]={ws:[M],ident:[I,F],0:[I,F],number:[I,F]},G[I]={ident:[I,F],0:[I,F],number:[I,F],ws:[L,H],".":[M,H],"[":[S,H],eof:[D,H]},G[S]={"'":[Z,F],'"':[B,F],"[":[S,N],"]":[L,q],eof:E,else:[S,F]},G[Z]={"'":[S,F],eof:E,else:[Z,F]},G[B]={'"':[S,F],eof:E,else:[B,F]};var J,K=/^\s?(true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/,Q=function(n){function t(n){if(null===n||void 0===n)return!0;if(Array.isArray(n)){if(n.length>0)return!1;if(0===n.length)return!0}else if(l(n))for(var t in n)if(c(n,t))return!1;return!0}function e(n,e){if(!u(n))return null;var r=v(e);if(t(r))return null;for(var o=r.length,i=null,a=n,l=0;l=0){var l=u.match(/(@:[\w|.]+)/g);for(var c in l){var f=l[c],s=f.substr(2),p=o(e,s,a);u=u.replace(f,p)}}return a?t.config.i18nFormatter?t.config.i18nFormatter.apply(null,[u].concat(a)):v(u,a):u}function l(n,t,e,r,a){var u=null;return u=o(n(t),r,a),i(u)?(u=o(n(e),r,a),i(u)?null:u):u}function c(n,e,r,o){return i(o)?(t.config.missingHandler&&t.config.missingHandler.apply(null,[n,e,r]),e):o}function f(n){return t.locale(n)}function s(n){return this.$options.locales[n]}function p(n){return n?n>1?1:0:1}function g(n,t){return n=Math.abs(n),2===t?p(n):n?Math.min(n,2):0}function d(n,t){if(!n&&"string"!=typeof n)return null;var e=n.split("|");return t=g(t,e.length),e[t]?e[t].trim():n}var v=x(t),h=Q(t);return t.t=function(n){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if(!n)return"";var o=e.apply(void 0,t),i=o.lang,a=o.fallback,u=o.params;return c(i,n,null,l(f,i,a,n,u))},t.tc=function(n,e){for(var r=[],o=arguments.length-2;o-- >0;)r[o]=arguments[o+2];return d(t.t.apply(t,[n].concat(r)),e)},t.te=function(n){for(var t=[],o=arguments.length-1;o-- >0;)t[o]=arguments[o+1];var i=e.apply(void 0,t),a=i.lang;return r(f(a),n)},t.prototype.$t=function(n){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if(!n)return"";var o=e.apply(void 0,t),i=o.lang,u=o.fallback,p=o.params,g=null;return this.$options.locales&&(g=l(a(s,this),i,u,n,p))?g:c(i,n,this,l(f,i,u,n,p))},t.prototype.$tc=function(n,t){for(var e=[],r=arguments.length-2;r-- >0;)e[r]=arguments[r+2];return"number"!=typeof t&&"undefined"!=typeof t?n:d((o=this).$t.apply(o,[n].concat(e)),t);var o},t.prototype.$te=function(n){for(var t=[],o=arguments.length-1;o-- >0;)t[o]=arguments[o+1];var i=e.apply(void 0,t),u=i.lang,l=!1;return this.$options.locales&&(l=r(a(s)(u),n)),l||(l=r(f(u),n)),l},t.mixin({computed:{$lang:function(){return t.config.lang}}}),t};return h.version="5.0.3","undefined"!=typeof window&&window.Vue&&window.Vue.use(h),h}); -------------------------------------------------------------------------------- /src/services/webpack.js: -------------------------------------------------------------------------------- 1 | const writeFile = require('./write-file'); 2 | 3 | exports.createWebpackBase = function (opts) { 4 | let css = ''; 5 | let vueCss = ''; 6 | if (opts.data.css.indexOf('less') > -1) { 7 | css += ` 8 | { 9 | test: /\\.less/, 10 | use: ExtractTextPlugin.extract({ 11 | use: ['css-loader?minimize', 'autoprefixer-loader', 'less-loader'], 12 | fallback: 'style-loader' 13 | }) 14 | }, 15 | `; 16 | vueCss += ` 17 | less: ExtractTextPlugin.extract({ 18 | use: ['css-loader?minimize', 'autoprefixer-loader', 'less-loader'], 19 | fallback: 'vue-style-loader' 20 | }), 21 | `; 22 | } 23 | if (opts.data.css.indexOf('sass') > -1) { 24 | css += ` 25 | { 26 | test: /\\.sass/, 27 | use: ExtractTextPlugin.extract({ 28 | use: ['autoprefixer-loader', 'sass-loader'], 29 | fallback: 'style-loader' 30 | }) 31 | }, 32 | `; 33 | vueCss += ` 34 | sass: ExtractTextPlugin.extract({ 35 | use: ['css-loader?minimize', 'autoprefixer-loader', 'sass-loader'], 36 | fallback: 'vue-style-loader' 37 | }), 38 | `; 39 | } 40 | 41 | const webpack = ` 42 | const path = require('path'); 43 | const webpack = require('webpack'); 44 | const ExtractTextPlugin = require('extract-text-webpack-plugin'); 45 | 46 | module.exports = { 47 | entry: { 48 | main: './src/main', 49 | vendors: './src/vendors' 50 | }, 51 | output: { 52 | path: path.join(__dirname, './dist') 53 | }, 54 | module: { 55 | rules: [ 56 | { 57 | test: /\.vue$/, 58 | use: [ 59 | { 60 | loader: 'vue-loader', 61 | options: { 62 | loaders: { 63 | less: ExtractTextPlugin.extract({ 64 | use: ['css-loader?minimize', 'autoprefixer-loader', 'less-loader'], 65 | fallback: 'vue-style-loader' 66 | }), 67 | css: ExtractTextPlugin.extract({ 68 | use: ['css-loader', 'autoprefixer-loader', 'less-loader'], 69 | fallback: 'vue-style-loader' 70 | }) 71 | } 72 | } 73 | }, 74 | { 75 | loader: 'iview-loader', 76 | options: { 77 | prefix: false 78 | } 79 | } 80 | ] 81 | }, 82 | { 83 | test: /iview\\/.*?js$/, 84 | loader: 'babel-loader' 85 | }, 86 | { 87 | test: /\\.js$/, 88 | loader: 'babel-loader', 89 | exclude: /node_modules/ 90 | }, 91 | { 92 | test: /\\.css$/, 93 | use: ExtractTextPlugin.extract({ 94 | use: ['css-loader?minimize', 'autoprefixer-loader'], 95 | fallback: 'style-loader' 96 | }) 97 | }, 98 | ${css} 99 | { 100 | test: /\\.(gif|jpg|png|woff|svg|eot|ttf)\\??.*$/, 101 | loader: 'url-loader?limit=1024' 102 | }, 103 | { 104 | test: /\\.(html|tpl)$/, 105 | loader: 'html-loader' 106 | } 107 | ] 108 | }, 109 | resolve: { 110 | extensions: ['.js', '.vue'], 111 | alias: { 112 | 'vue': 'vue/dist/vue.esm.js' 113 | } 114 | } 115 | }; 116 | `; 117 | writeFile({ 118 | directory: opts.directory, 119 | fileName: 'webpack.base.config.js', 120 | data: webpack, 121 | success () { 122 | opts.success(); 123 | }, 124 | error () { 125 | opts.error(); 126 | } 127 | }); 128 | }; 129 | 130 | exports.createWebpackDev = function (opts) { 131 | const webpack = ` 132 | const webpack = require('webpack'); 133 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 134 | const ExtractTextPlugin = require('extract-text-webpack-plugin'); 135 | const merge = require('webpack-merge'); 136 | const webpackBaseConfig = require('./webpack.base.config.js'); 137 | const fs = require('fs'); 138 | 139 | fs.open('./src/config/env.js', 'w', function (err, fd) { 140 | const buf = 'export default "development";'; 141 | fs.write(fd, buf, 0, buf.length, 0, function (err, written, buffer){}); 142 | }); 143 | 144 | module.exports = merge(webpackBaseConfig, { 145 | devtool: '#source-map', 146 | output: { 147 | publicPath: '/dist/', 148 | filename: '[name].js', 149 | chunkFilename: '[name].chunk.js' 150 | }, 151 | plugins: [ 152 | new ExtractTextPlugin({ 153 | filename: '[name].css', 154 | allChunks: true 155 | }), 156 | new webpack.optimize.CommonsChunkPlugin({ 157 | name: 'vendors', 158 | filename: 'vendors.js' 159 | }), 160 | new HtmlWebpackPlugin({ 161 | filename: '../index.html', 162 | template: './src/template/index.ejs', 163 | inject: false 164 | }) 165 | ] 166 | }); 167 | `; 168 | writeFile({ 169 | directory: opts.directory, 170 | fileName: 'webpack.dev.config.js', 171 | data: webpack, 172 | success () { 173 | opts.success(); 174 | }, 175 | error () { 176 | opts.error(); 177 | } 178 | }); 179 | }; 180 | 181 | exports.createWebpackProd = function (opts) { 182 | const webpack = ` 183 | const webpack = require('webpack'); 184 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 185 | const ExtractTextPlugin = require('extract-text-webpack-plugin'); 186 | const merge = require('webpack-merge'); 187 | const webpackBaseConfig = require('./webpack.base.config.js'); 188 | const fs = require('fs'); 189 | 190 | fs.open('./src/config/env.js', 'w', function (err, fd) { 191 | const buf = 'export default "production";'; 192 | fs.write(fd, buf, 0, buf.length, 0, function (err, written, buffer){}); 193 | }); 194 | 195 | module.exports = merge(webpackBaseConfig, { 196 | output: { 197 | publicPath: '/dist/', 198 | filename: '[name].[hash].js', 199 | chunkFilename: '[name].[hash].chunk.js' 200 | }, 201 | plugins: [ 202 | new ExtractTextPlugin({ 203 | filename: '[name].[hash].css', 204 | allChunks: true 205 | }), 206 | new webpack.optimize.CommonsChunkPlugin({ 207 | name: 'vendors', 208 | filename: 'vendors.[hash].js' 209 | }), 210 | new webpack.DefinePlugin({ 211 | 'process.env': { 212 | NODE_ENV: '"production"' 213 | } 214 | }), 215 | new webpack.optimize.UglifyJsPlugin({ 216 | compress: { 217 | warnings: false 218 | } 219 | }), 220 | new HtmlWebpackPlugin({ 221 | filename: '../index_prod.html', 222 | template: './src/template/index.ejs', 223 | inject: false 224 | }) 225 | ] 226 | }); 227 | `; 228 | writeFile({ 229 | directory: opts.directory, 230 | fileName: 'webpack.prod.config.js', 231 | data: webpack, 232 | success () { 233 | opts.success(); 234 | }, 235 | error () { 236 | opts.error(); 237 | } 238 | }); 239 | }; -------------------------------------------------------------------------------- /app/create.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | iView 7 | 8 | 9 | 10 | 11 |
    12 |
    iView - {{ $t("message.newProject") }}
    13 |
    14 | iView - {{ $t("message.creating") }} 15 | 16 |
    17 |
    18 | iView - {{ $t("message.createDone") }} 19 | 20 |
    21 |
    22 | iView - {{ $t("message.creatingError") }} 23 | 24 |
    25 |
    iView - {{ $t("message.moreConf") }}
    26 |
    27 |
    28 | 29 | 30 | 31 | 2.7.2 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 |
    42 | Ajax 43 | 44 | 45 | 46 | 47 |
    48 | 49 | 50 | 51 | 52 |
    53 | 54 |
    55 | {{ $t('message.multilingual') }} 56 | 57 | 58 | 59 | 60 |
    61 | 62 | 63 | 64 | 65 |
    66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | Cookie(js-cookie) 86 | {{ $t('message.copy') }}(clipboard) 87 | {{ $t('message.html2canvas') }}(html2canvas) 88 | {{ $t('message.rasterizeHtml') }}(rasterizeHTML) 89 | 90 | 91 | 92 | {{ $t('message.showMoreConf') }} 93 | 94 | 95 |
    96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 |
    109 |
    110 | 111 | 112 | {{ $t('message.createProject') }} 113 | 114 | 115 | {{ $t('message.reset') }} 116 | 117 | 118 |
    119 |
    120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | {{ $t('message.furtherConf') }} 144 | 145 | 146 | {{ $t('message.openDirectory') }} 147 | 148 | 149 |
    150 |
    151 | 152 | 153 | 154 | iView Cli {{ $t('message.hasSaveAt') }} {{ $t('message.directory') }},{{ $t('message.whatToDoNext') }} 155 | 156 | 157 | {{ $t('message.installSomeToolsFirst') }} 158 |

    {{ $t('message.installDependencies') }}

    159 | $ npm install 160 |

    {{ $t('message.startService') }}

    161 | $ npm run dev 162 |

    163 | {{ $t('message.openWebsiteLeftText') }} http://127.0.0.1:8080 {{ $t('message.openWebsiteRightText') }} 164 |

    165 |

    166 |

    {{ $t('message.compileAndPackage') }}

    167 | $ npm run build 168 | 172 |

    {{ $t('message.modifyHtmlTemplate') }}

    173 |

    {{ $t('message.modifyIndexLeftText') }} src/template/index.ejs {{ $t('message.modifyIndexRightText') }}

    174 | 178 | 183 | 184 | 185 | {{ $t('message.backHome') }} 186 | 187 | 188 | {{ $t('message.openDirectory') }} 189 | 190 | 191 |
    192 |
    193 |
    194 | 195 | 196 | 197 | 198 | 199 | -------------------------------------------------------------------------------- /src/create.js: -------------------------------------------------------------------------------- 1 | const electron = require('electron'); 2 | const remote = electron.remote; 3 | const BrowserWindow = remote.BrowserWindow; 4 | const win = BrowserWindow.getAllWindows()[0]; 5 | const dialog = remote.dialog; 6 | const shell = electron.shell; 7 | 8 | const fs = require('fs'); 9 | const path = require('path'); 10 | 11 | const zhLang = require('../assets/lang/zh').zhLang; 12 | const enLang = require('../assets/lang/en').enLang; 13 | const i18n = require('vue-i18n'); 14 | let locales = { 15 | en: { 16 | message: enLang 17 | }, 18 | zh: { 19 | message: zhLang 20 | } 21 | } 22 | 23 | let _path = path.join(__dirname, '../conf/lang.json'); 24 | let getLang = fs.readFileSync(_path); 25 | let language = getLang? JSON.parse(getLang): { lang: 'zh', message: 'EN' }; 26 | Vue.config.lang = language.lang; 27 | 28 | Object.keys(locales).forEach(function(lang){ 29 | Vue.locale(lang, locales[lang]) 30 | }) 31 | 32 | const createPackage = require('../src/services/package'); 33 | const createBabel = require('../src/services/babel'); 34 | const { createWebpackBase, createWebpackDev, createWebpackProd } = require('../src/services/webpack'); 35 | const createVendors = require('../src/services/vendors'); 36 | const createRouter = require('../src/services/router'); 37 | const createI18n = require('../src/services/i18n'); 38 | const createApp = require('../src/services/app'); 39 | const createTemplate = require('../src/services/template'); 40 | const createIndexVue = require('../src/services/index-vue'); 41 | const createIndexHtml = require('../src/services/index-html'); 42 | const createMain = require('../src/services/main'); 43 | const createConfig = require('../src/services/config'); 44 | const createUtil = require('../src/services/util'); 45 | // const { createVuexStore, createVuexActions, createVuexMutations } = require('../src/services/vuex'); 46 | const createBus = require('../src/services/bus'); 47 | const { createESLintRc, createESLintIgnore } = require('../src/services/eslint'); 48 | const createGitignore = require('../src/services/gitignore'); 49 | const createEditorconfig = require('../src/services/editorconfig'); 50 | 51 | let saveDirectory = undefined; 52 | 53 | Vue.component('log', { 54 | template: ` 55 |
  • 56 | 57 | 58 | 59 | {{ content }} 60 |
  • 61 | `, 62 | props: ['content', 'status'] 63 | }); 64 | 65 | const app = new Vue({ 66 | el: '#app', 67 | data: { 68 | formValidate: { 69 | iviewVersion: '2.x', 70 | css: [], 71 | ajax: true, 72 | i18n: false, 73 | store: [], 74 | chart: [], 75 | eslint: true, 76 | funs: [], 77 | name: '', 78 | version: '1.0.0', 79 | desc: '', 80 | git: '' 81 | }, 82 | ruleValidate: { 83 | 84 | }, 85 | showMore: false, 86 | status: 'options', // options,log,next 87 | log: { // 1 is doing, 2 is done, 3 is error 88 | package: 1, 89 | babel: 1, 90 | webpackBase: 1, 91 | webpackDev: 1, 92 | webpackProd: 1, 93 | vendors: 1, 94 | router: 1, 95 | i18n: 1, 96 | app: 1, 97 | indexHtml: 1, 98 | indexVue: 1, 99 | template: 1, 100 | main: 1, 101 | config: 1, 102 | util: 1, 103 | // vuexStore: 1, 104 | // vuexActions: 1, 105 | // vuexMutations: 1, 106 | bus: 1, 107 | eslintRc: 1, 108 | eslintIgnore: 1, 109 | gitignore: 1, 110 | editorconfig: 1 111 | }, 112 | language: language, 113 | }, 114 | computed: { 115 | titleStatus () { 116 | let status = 2; 117 | for (let i in this.log) { 118 | let item = this.log[i]; 119 | 120 | if (i === 'i18n' && !this.formValidate.i18n) continue; 121 | if (i === 'vuexStore' && this.formValidate.store.indexOf('vuex') < 0) continue; 122 | if (i === 'vuexActions' && this.formValidate.store.indexOf('vuex') < 0) continue; 123 | if (i === 'vuexMutations' && this.formValidate.store.indexOf('vuex') < 0) continue; 124 | if (i === 'bus' && this.formValidate.store.indexOf('bus') < 0) continue; 125 | if (i === 'eslintRc' && !this.formValidate.eslintRc) continue; 126 | if (i === 'eslintIgnore' && !this.formValidate.eslintRc) continue; 127 | 128 | if (item === 1) { 129 | status = 1; 130 | break; 131 | } 132 | if (item === 3) { 133 | status = 3; 134 | break; 135 | } 136 | status = 2; 137 | } 138 | 139 | return status; 140 | } 141 | }, 142 | methods: { 143 | handleSubmit (name) { 144 | this.$refs[name].validate((valid) => { 145 | if (valid) { 146 | saveDirectory = dialog.showOpenDialog(win, { 147 | title: app.$t('message.selectDir'), 148 | properties: ['openDirectory', 'createDirectory'] 149 | }); 150 | 151 | if (saveDirectory) { 152 | saveDirectory = saveDirectory[0]; 153 | this.status = 'log'; 154 | 155 | // package.json 156 | createPackage({ 157 | data: this.formValidate, 158 | directory: saveDirectory, 159 | success: () => { 160 | this.log.package = 2; 161 | }, 162 | error: () => { 163 | this.log.package = 3; 164 | } 165 | }); 166 | 167 | // .babelrc 168 | createBabel({ 169 | data: this.formValidate, 170 | directory: saveDirectory, 171 | success: () => { 172 | this.log.babel = 2; 173 | }, 174 | error: () => { 175 | this.log.babel = 3; 176 | } 177 | }); 178 | 179 | // webpack 180 | createWebpackBase({ 181 | data: this.formValidate, 182 | directory: saveDirectory, 183 | success: () => { 184 | this.log.webpackBase = 2; 185 | }, 186 | error: () => { 187 | this.log.webpackBase = 3; 188 | } 189 | }); 190 | createWebpackDev({ 191 | data: this.formValidate, 192 | directory: saveDirectory, 193 | success: () => { 194 | this.log.webpackDev = 2; 195 | }, 196 | error: () => { 197 | this.log.webpackDev = 3; 198 | } 199 | }); 200 | createWebpackProd({ 201 | data: this.formValidate, 202 | directory: saveDirectory, 203 | success: () => { 204 | this.log.webpackProd = 2; 205 | }, 206 | error: () => { 207 | this.log.webpackProd = 3; 208 | } 209 | }); 210 | 211 | // vendors 212 | createVendors({ 213 | data: this.formValidate, 214 | directory: saveDirectory, 215 | success: () => { 216 | this.log.vendors = 2; 217 | }, 218 | error: () => { 219 | this.log.vendors = 3; 220 | } 221 | }); 222 | 223 | // router 224 | createRouter({ 225 | data: this.formValidate, 226 | directory: saveDirectory, 227 | success: () => { 228 | this.log.router = 2; 229 | }, 230 | error: () => { 231 | this.log.router = 3; 232 | } 233 | }); 234 | 235 | // i18n 236 | if (this.formValidate.i18n) { 237 | createI18n({ 238 | data: this.formValidate, 239 | directory: saveDirectory, 240 | success: () => { 241 | this.log.i18n = 2; 242 | }, 243 | error: () => { 244 | this.log.i18n = 3; 245 | } 246 | }); 247 | } 248 | 249 | // app.vue 250 | createApp({ 251 | data: this.formValidate, 252 | directory: saveDirectory, 253 | success: () => { 254 | this.log.app = 2; 255 | }, 256 | error: () => { 257 | this.log.app = 3; 258 | } 259 | }); 260 | 261 | // index.ejs 262 | createTemplate({ 263 | data: this.formValidate, 264 | directory: saveDirectory, 265 | success: () => { 266 | this.log.template = 2; 267 | }, 268 | error: () => { 269 | this.log.template = 3; 270 | } 271 | }); 272 | 273 | // index.html 274 | createIndexHtml({ 275 | data: this.formValidate, 276 | directory: saveDirectory, 277 | success: () => { 278 | this.log.indexHtml = 2; 279 | }, 280 | error: () => { 281 | this.log.indexHtml = 3; 282 | } 283 | }); 284 | 285 | // index.vue 286 | createIndexVue({ 287 | data: this.formValidate, 288 | directory: saveDirectory, 289 | success: () => { 290 | this.log.indexVue = 2; 291 | }, 292 | error: () => { 293 | this.log.indexVue = 3; 294 | } 295 | }); 296 | 297 | // main 298 | createMain({ 299 | data: this.formValidate, 300 | directory: saveDirectory, 301 | success: () => { 302 | this.log.main = 2; 303 | }, 304 | error: () => { 305 | this.log.main = 3; 306 | } 307 | }); 308 | 309 | // config.js 310 | createConfig({ 311 | data: this.formValidate, 312 | directory: saveDirectory, 313 | success: () => { 314 | this.log.config = 2; 315 | }, 316 | error: () => { 317 | this.log.config = 3; 318 | } 319 | }); 320 | 321 | // util.js 322 | createUtil({ 323 | data: this.formValidate, 324 | directory: saveDirectory, 325 | success: () => { 326 | this.log.util = 2; 327 | }, 328 | error: () => { 329 | this.log.util = 3; 330 | } 331 | }); 332 | 333 | // vuex 334 | // if (this.formValidate.store.indexOf('vuex') > -1) { 335 | // createVuexStore({ 336 | // data: this.formValidate, 337 | // directory: saveDirectory, 338 | // success: () => { 339 | // this.log.vuexStore = 2; 340 | // }, 341 | // error: () => { 342 | // this.log.vuexStore = 3; 343 | // } 344 | // }); 345 | // createVuexActions({ 346 | // data: this.formValidate, 347 | // directory: saveDirectory, 348 | // success: () => { 349 | // this.log.vuexActions = 2; 350 | // }, 351 | // error: () => { 352 | // this.log.vuexActions = 3; 353 | // } 354 | // }); 355 | // createVuexMutations({ 356 | // data: this.formValidate, 357 | // directory: saveDirectory, 358 | // success: () => { 359 | // this.log.vuexMutations = 2; 360 | // }, 361 | // error: () => { 362 | // this.log.vuexMutations = 3; 363 | // } 364 | // }); 365 | // } 366 | 367 | // bus.js 368 | if (this.formValidate.store.indexOf('bus.js') > -1) { 369 | createBus({ 370 | data: this.formValidate, 371 | directory: saveDirectory, 372 | success: () => { 373 | this.log.bus = 2; 374 | }, 375 | error: () => { 376 | this.log.bus = 3; 377 | } 378 | }); 379 | } 380 | 381 | // ESLint 382 | if (this.formValidate.eslint) { 383 | createESLintRc({ 384 | data: this.formValidate, 385 | directory: saveDirectory, 386 | success: () => { 387 | this.log.eslintRc = 2; 388 | }, 389 | error: () => { 390 | this.log.eslintRc = 3; 391 | } 392 | }); 393 | createESLintIgnore({ 394 | data: this.formValidate, 395 | directory: saveDirectory, 396 | success: () => { 397 | this.log.eslintIgnore = 2; 398 | }, 399 | error: () => { 400 | this.log.eslintIgnore = 3; 401 | } 402 | }); 403 | } 404 | 405 | // .gitignore 406 | createGitignore({ 407 | data: this.formValidate, 408 | directory: saveDirectory, 409 | success: () => { 410 | this.log.gitignore = 2; 411 | }, 412 | error: () => { 413 | this.log.gitignore = 3; 414 | } 415 | }); 416 | 417 | // .editorconfig 418 | createEditorconfig({ 419 | data: this.formValidate, 420 | directory: saveDirectory, 421 | success: () => { 422 | this.log.editorconfig = 2; 423 | }, 424 | error: () => { 425 | this.log.editorconfig = 3; 426 | } 427 | }); 428 | } 429 | } 430 | }); 431 | }, 432 | handleReset (name) { 433 | this.$refs[name].resetFields(); 434 | }, 435 | handleShowMore () { 436 | this.showMore = true; 437 | }, 438 | handleNext () { 439 | this.status = 'next'; 440 | }, 441 | handleOpenDirectory () { 442 | shell.showItemInFolder(saveDirectory); 443 | }, 444 | handleOpenFile (path) { 445 | shell.openItem(`${saveDirectory}/${path}`); 446 | }, 447 | handleOpenLink (url) { 448 | shell.openExternal(url); 449 | }, 450 | handleBackHome () { 451 | window.location.href = 'index.html'; 452 | } 453 | } 454 | }); -------------------------------------------------------------------------------- /assets/js/vue-i18n.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * vue-i18n v5.0.3 3 | * (c) 2017 kazuya kawaguchi 4 | * Released under the MIT License. 5 | */ 6 | (function (global, factory) { 7 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 8 | typeof define === 'function' && define.amd ? define(factory) : 9 | (global.VueI18n = factory()); 10 | }(this, (function () { 'use strict'; 11 | 12 | /** 13 | * warn 14 | * 15 | * @param {String} msg 16 | * @param {Error} [err] 17 | * 18 | */ 19 | 20 | function warn (msg, err) { 21 | if (window.console) { 22 | console.warn('[vue-i18n] ' + msg); 23 | if (err) { 24 | console.warn(err.stack); 25 | } 26 | } 27 | } 28 | 29 | var Asset = function (Vue, langVM) { 30 | /** 31 | * Register or retrieve a global locale definition. 32 | * 33 | * @param {String} id 34 | * @param {Object | Function | Promise} definition 35 | * @param {Function} cb 36 | */ 37 | 38 | Vue.locale = function (id, definition, cb) { 39 | if (definition === undefined) { // getter 40 | return langVM.locales[id] 41 | } else { // setter 42 | if (definition === null) { 43 | langVM.locales[id] = undefined; 44 | delete langVM.locales[id]; 45 | } else { 46 | setLocale(id, definition, function (locale) { 47 | if (locale) { 48 | langVM.$set(langVM.locales, id, locale); 49 | } else { 50 | warn('failed set `' + id + '` locale'); 51 | } 52 | cb && cb(); 53 | }); 54 | } 55 | } 56 | }; 57 | }; 58 | 59 | 60 | function setLocale (id, definition, cb) { 61 | if (typeof definition === 'object') { // sync 62 | cb(definition); 63 | } else { 64 | var future = definition.call(this); 65 | if (typeof future === 'function') { 66 | if (future.resolved) { 67 | // cached 68 | cb(future.resolved); 69 | } else if (future.requested) { 70 | // pool callbacks 71 | future.pendingCallbacks.push(cb); 72 | } else { 73 | future.requested = true; 74 | var cbs = future.pendingCallbacks = [cb]; 75 | future(function (locale) { // resolve 76 | future.resolved = locale; 77 | for (var i = 0, l = cbs.length; i < l; i++) { 78 | cbs[i](locale); 79 | } 80 | }, function () { // reject 81 | cb(); 82 | }); 83 | } 84 | } else if (isPromise(future)) { // promise 85 | future.then(function (locale) { // resolve 86 | cb(locale); 87 | }, function () { // reject 88 | cb(); 89 | }).catch(function (err) { 90 | console.error(err); 91 | cb(); 92 | }); 93 | } 94 | } 95 | } 96 | 97 | /** 98 | * Forgiving check for a promise 99 | * 100 | * @param {Object} p 101 | * @return {Boolean} 102 | */ 103 | 104 | function isPromise (p) { 105 | return p && typeof p.then === 'function' 106 | } 107 | 108 | var Override = function (Vue, langVM) { 109 | // override _init 110 | var init = Vue.prototype._init; 111 | Vue.prototype._init = function (options) { 112 | var this$1 = this; 113 | 114 | init.call(this, options); 115 | 116 | if (!this.$parent) { // root 117 | this._$lang = langVM; 118 | this._langUnwatch = this._$lang.$watch('$data', function (val, old) { 119 | this$1.$forceUpdate(); 120 | }, { deep: true }); 121 | } 122 | }; 123 | 124 | // override _destroy 125 | var destroy = Vue.prototype._destroy; 126 | Vue.prototype._destroy = function () { 127 | if (!this.$parent && this._langUnwatch) { 128 | this._langUnwatch(); 129 | this._langUnwatch = null; 130 | this._$lang = null; 131 | } 132 | 133 | destroy.apply(this, arguments); 134 | }; 135 | }; 136 | 137 | /** 138 | * Observer 139 | */ 140 | 141 | var Watcher; 142 | /** 143 | * getWatcher 144 | * 145 | * @param {Vue} vm 146 | * @return {Watcher} 147 | */ 148 | 149 | function getWatcher (vm) { 150 | if (!Watcher) { 151 | var unwatch = vm.$watch('__watcher__', function (a) {}); 152 | Watcher = vm._watchers[0].constructor; 153 | unwatch(); 154 | } 155 | return Watcher 156 | } 157 | 158 | var Dep; 159 | /** 160 | * getDep 161 | * 162 | * @param {Vue} vm 163 | * @return {Dep} 164 | */ 165 | 166 | function getDep (vm) { 167 | if (!Dep && vm && vm._data && vm._data.__ob__ && vm._data.__ob__.dep) { 168 | Dep = vm._data.__ob__.dep.constructor; 169 | } 170 | return Dep 171 | } 172 | 173 | /** 174 | * utilites 175 | */ 176 | 177 | /** 178 | * isNil 179 | * 180 | * @param {*} val 181 | * @return Boolean 182 | */ 183 | function isNil (val) { 184 | return val === null || val === undefined 185 | } 186 | 187 | /** 188 | * Simple bind, faster than native 189 | * 190 | * @param {Function} fn 191 | * @param {Object} ctx 192 | * @return Function 193 | */ 194 | function bind (fn, ctx) { 195 | function boundFn (a) { 196 | var l = arguments.length; 197 | return l 198 | ? l > 1 199 | ? fn.apply(ctx, arguments) 200 | : fn.call(ctx, a) 201 | : fn.call(ctx) 202 | } 203 | // record original fn length 204 | boundFn._length = fn.length; 205 | return boundFn 206 | } 207 | 208 | /** 209 | * Quick object check - this is primarily used to tell 210 | * Objects from primitive values when we know the value 211 | * is a JSON-compliant type. 212 | * 213 | * @param {Object} obj 214 | * @return Boolean 215 | */ 216 | function isObject (obj) { 217 | return obj !== null && typeof obj === 'object' 218 | } 219 | 220 | /** 221 | * Strict object type check. Only returns true 222 | * for plain JavaScript objects. 223 | * 224 | * @param {Object} obj 225 | * @return Boolean 226 | */ 227 | var toString = Object.prototype.toString; 228 | var OBJECT_STRING = '[object Object]'; 229 | function isPlainObject (obj) { 230 | return toString.call(obj) === OBJECT_STRING 231 | } 232 | 233 | /** 234 | * Check whether the object has the property. 235 | * 236 | * @param {Object} obj 237 | * @param {String} key 238 | * @return Boolean 239 | */ 240 | var hasOwnProperty = Object.prototype.hasOwnProperty; 241 | function hasOwn (obj, key) { 242 | return hasOwnProperty.call(obj, key) 243 | } 244 | 245 | var fallback; // fallback lang 246 | var missingHandler = null; // missing handler 247 | var i18nFormatter = null; // custom formatter 248 | 249 | var Config = function (Vue, langVM, lang) { 250 | var Watcher = getWatcher(langVM); 251 | var Dep = getDep(langVM); 252 | 253 | function makeComputedGetter (getter, owner) { 254 | var watcher = new Watcher(owner, getter, null, { 255 | lazy: true 256 | }); 257 | 258 | return function computedGetter () { 259 | watcher.dirty && watcher.evaluate(); 260 | Dep && Dep.target && watcher.depend(); 261 | return watcher.value 262 | } 263 | } 264 | 265 | // define Vue.config.lang configration 266 | Object.defineProperty(Vue.config, 'lang', { 267 | enumerable: true, 268 | configurable: true, 269 | get: makeComputedGetter(function () { return langVM.lang }, langVM), 270 | set: bind(function (val) { langVM.lang = val; }, langVM) 271 | }); 272 | 273 | // define Vue.config.fallbackLang configration 274 | fallback = lang; 275 | Object.defineProperty(Vue.config, 'fallbackLang', { 276 | enumerable: true, 277 | configurable: true, 278 | get: function () { return fallback }, 279 | set: function (val) { fallback = val; } 280 | }); 281 | 282 | // define Vue.config.missingHandler configration 283 | Object.defineProperty(Vue.config, 'missingHandler', { 284 | enumerable: true, 285 | configurable: true, 286 | get: function () { return missingHandler }, 287 | set: function (val) { missingHandler = val; } 288 | }); 289 | 290 | // define Vue.config.i18Formatter configration 291 | Object.defineProperty(Vue.config, 'i18nFormatter', { 292 | enumerable: true, 293 | configurable: true, 294 | get: function () { return i18nFormatter }, 295 | set: function (val) { i18nFormatter = val; } 296 | }); 297 | }; 298 | 299 | /** 300 | * String format template 301 | * - Inspired: 302 | * https://github.com/Matt-Esch/string-template/index.js 303 | */ 304 | 305 | var RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g; 306 | 307 | 308 | var Format = function (Vue) { 309 | /** 310 | * template 311 | * 312 | * @param {String} string 313 | * @param {Array} ...args 314 | * @return {String} 315 | */ 316 | 317 | function template (string) { 318 | var args = [], len = arguments.length - 1; 319 | while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ]; 320 | 321 | if (args.length === 1 && typeof args[0] === 'object') { 322 | args = args[0]; 323 | } else { 324 | args = {}; 325 | } 326 | 327 | if (!args || !args.hasOwnProperty) { 328 | args = {}; 329 | } 330 | 331 | return string.replace(RE_NARGS, function (match, prefix, i, index) { 332 | var result; 333 | 334 | if (string[index - 1] === '{' && 335 | string[index + match.length] === '}') { 336 | return i 337 | } else { 338 | result = hasOwn(args, i) ? args[i] : match; 339 | if (isNil(result)) { 340 | return '' 341 | } 342 | 343 | return result 344 | } 345 | }) 346 | } 347 | 348 | return template 349 | }; 350 | 351 | /** 352 | * Path paerser 353 | * - Inspired: 354 | * Vue.js Path parser 355 | */ 356 | 357 | // cache 358 | var pathCache = Object.create(null); 359 | 360 | // actions 361 | var APPEND = 0; 362 | var PUSH = 1; 363 | var INC_SUB_PATH_DEPTH = 2; 364 | var PUSH_SUB_PATH = 3; 365 | 366 | // states 367 | var BEFORE_PATH = 0; 368 | var IN_PATH = 1; 369 | var BEFORE_IDENT = 2; 370 | var IN_IDENT = 3; 371 | var IN_SUB_PATH = 4; 372 | var IN_SINGLE_QUOTE = 5; 373 | var IN_DOUBLE_QUOTE = 6; 374 | var AFTER_PATH = 7; 375 | var ERROR = 8; 376 | 377 | var pathStateMachine = []; 378 | 379 | pathStateMachine[BEFORE_PATH] = { 380 | 'ws': [BEFORE_PATH], 381 | 'ident': [IN_IDENT, APPEND], 382 | '[': [IN_SUB_PATH], 383 | 'eof': [AFTER_PATH] 384 | }; 385 | 386 | pathStateMachine[IN_PATH] = { 387 | 'ws': [IN_PATH], 388 | '.': [BEFORE_IDENT], 389 | '[': [IN_SUB_PATH], 390 | 'eof': [AFTER_PATH] 391 | }; 392 | 393 | pathStateMachine[BEFORE_IDENT] = { 394 | 'ws': [BEFORE_IDENT], 395 | 'ident': [IN_IDENT, APPEND], 396 | '0': [IN_IDENT, APPEND], 397 | 'number': [IN_IDENT, APPEND] 398 | }; 399 | 400 | pathStateMachine[IN_IDENT] = { 401 | 'ident': [IN_IDENT, APPEND], 402 | '0': [IN_IDENT, APPEND], 403 | 'number': [IN_IDENT, APPEND], 404 | 'ws': [IN_PATH, PUSH], 405 | '.': [BEFORE_IDENT, PUSH], 406 | '[': [IN_SUB_PATH, PUSH], 407 | 'eof': [AFTER_PATH, PUSH] 408 | }; 409 | 410 | pathStateMachine[IN_SUB_PATH] = { 411 | "'": [IN_SINGLE_QUOTE, APPEND], 412 | '"': [IN_DOUBLE_QUOTE, APPEND], 413 | '[': [IN_SUB_PATH, INC_SUB_PATH_DEPTH], 414 | ']': [IN_PATH, PUSH_SUB_PATH], 415 | 'eof': ERROR, 416 | 'else': [IN_SUB_PATH, APPEND] 417 | }; 418 | 419 | pathStateMachine[IN_SINGLE_QUOTE] = { 420 | "'": [IN_SUB_PATH, APPEND], 421 | 'eof': ERROR, 422 | 'else': [IN_SINGLE_QUOTE, APPEND] 423 | }; 424 | 425 | pathStateMachine[IN_DOUBLE_QUOTE] = { 426 | '"': [IN_SUB_PATH, APPEND], 427 | 'eof': ERROR, 428 | 'else': [IN_DOUBLE_QUOTE, APPEND] 429 | }; 430 | 431 | /** 432 | * Check if an expression is a literal value. 433 | * 434 | * @param {String} exp 435 | * @return {Boolean} 436 | */ 437 | 438 | var literalValueRE = /^\s?(true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/; 439 | function isLiteral (exp) { 440 | return literalValueRE.test(exp) 441 | } 442 | 443 | /** 444 | * Strip quotes from a string 445 | * 446 | * @param {String} str 447 | * @return {String | false} 448 | */ 449 | 450 | function stripQuotes (str) { 451 | var a = str.charCodeAt(0); 452 | var b = str.charCodeAt(str.length - 1); 453 | return a === b && (a === 0x22 || a === 0x27) 454 | ? str.slice(1, -1) 455 | : str 456 | } 457 | 458 | /** 459 | * Determine the type of a character in a keypath. 460 | * 461 | * @param {Char} ch 462 | * @return {String} type 463 | */ 464 | 465 | function getPathCharType (ch) { 466 | if (ch === undefined) { return 'eof' } 467 | 468 | var code = ch.charCodeAt(0); 469 | 470 | switch (code) { 471 | case 0x5B: // [ 472 | case 0x5D: // ] 473 | case 0x2E: // . 474 | case 0x22: // " 475 | case 0x27: // ' 476 | case 0x30: // 0 477 | return ch 478 | 479 | case 0x5F: // _ 480 | case 0x24: // $ 481 | case 0x2D: // - 482 | return 'ident' 483 | 484 | case 0x20: // Space 485 | case 0x09: // Tab 486 | case 0x0A: // Newline 487 | case 0x0D: // Return 488 | case 0xA0: // No-break space 489 | case 0xFEFF: // Byte Order Mark 490 | case 0x2028: // Line Separator 491 | case 0x2029: // Paragraph Separator 492 | return 'ws' 493 | } 494 | 495 | // a-z, A-Z 496 | if ((code >= 0x61 && code <= 0x7A) || (code >= 0x41 && code <= 0x5A)) { 497 | return 'ident' 498 | } 499 | 500 | // 1-9 501 | if (code >= 0x31 && code <= 0x39) { return 'number' } 502 | 503 | return 'else' 504 | } 505 | 506 | /** 507 | * Format a subPath, return its plain form if it is 508 | * a literal string or number. Otherwise prepend the 509 | * dynamic indicator (*). 510 | * 511 | * @param {String} path 512 | * @return {String} 513 | */ 514 | 515 | function formatSubPath (path) { 516 | var trimmed = path.trim(); 517 | // invalid leading 0 518 | if (path.charAt(0) === '0' && isNaN(path)) { return false } 519 | 520 | return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed 521 | } 522 | 523 | /** 524 | * Parse a string path into an array of segments 525 | * 526 | * @param {String} path 527 | * @return {Array|undefined} 528 | */ 529 | 530 | function parse (path) { 531 | var keys = []; 532 | var index = -1; 533 | var mode = BEFORE_PATH; 534 | var subPathDepth = 0; 535 | var c, newChar, key, type, transition, action, typeMap; 536 | 537 | var actions = []; 538 | 539 | actions[PUSH] = function () { 540 | if (key !== undefined) { 541 | keys.push(key); 542 | key = undefined; 543 | } 544 | }; 545 | 546 | actions[APPEND] = function () { 547 | if (key === undefined) { 548 | key = newChar; 549 | } else { 550 | key += newChar; 551 | } 552 | }; 553 | 554 | actions[INC_SUB_PATH_DEPTH] = function () { 555 | actions[APPEND](); 556 | subPathDepth++; 557 | }; 558 | 559 | actions[PUSH_SUB_PATH] = function () { 560 | if (subPathDepth > 0) { 561 | subPathDepth--; 562 | mode = IN_SUB_PATH; 563 | actions[APPEND](); 564 | } else { 565 | subPathDepth = 0; 566 | key = formatSubPath(key); 567 | if (key === false) { 568 | return false 569 | } else { 570 | actions[PUSH](); 571 | } 572 | } 573 | }; 574 | 575 | function maybeUnescapeQuote () { 576 | var nextChar = path[index + 1]; 577 | if ((mode === IN_SINGLE_QUOTE && nextChar === "'") || 578 | (mode === IN_DOUBLE_QUOTE && nextChar === '"')) { 579 | index++; 580 | newChar = '\\' + nextChar; 581 | actions[APPEND](); 582 | return true 583 | } 584 | } 585 | 586 | while (mode != null) { 587 | index++; 588 | c = path[index]; 589 | 590 | if (c === '\\' && maybeUnescapeQuote()) { 591 | continue 592 | } 593 | 594 | type = getPathCharType(c); 595 | typeMap = pathStateMachine[mode]; 596 | transition = typeMap[type] || typeMap['else'] || ERROR; 597 | 598 | if (transition === ERROR) { 599 | return // parse error 600 | } 601 | 602 | mode = transition[0]; 603 | action = actions[transition[1]]; 604 | if (action) { 605 | newChar = transition[2]; 606 | newChar = newChar === undefined 607 | ? c 608 | : newChar; 609 | if (action() === false) { 610 | return 611 | } 612 | } 613 | 614 | if (mode === AFTER_PATH) { 615 | keys.raw = path; 616 | return keys 617 | } 618 | } 619 | } 620 | 621 | /** 622 | * External parse that check for a cache hit first 623 | * 624 | * @param {String} path 625 | * @return {Array|undefined} 626 | */ 627 | 628 | function parsePath (path) { 629 | var hit = pathCache[path]; 630 | if (!hit) { 631 | hit = parse(path); 632 | if (hit) { 633 | pathCache[path] = hit; 634 | } 635 | } 636 | return hit 637 | } 638 | 639 | var Path = function (Vue) { 640 | function empty (target) { 641 | if (target === null || target === undefined) { return true } 642 | 643 | if (Array.isArray(target)) { 644 | if (target.length > 0) { return false } 645 | if (target.length === 0) { return true } 646 | } else if (isPlainObject(target)) { 647 | /* eslint-disable prefer-const */ 648 | for (var key in target) { 649 | if (hasOwn(target, key)) { return false } 650 | } 651 | /* eslint-enable prefer-const */ 652 | } 653 | 654 | return true 655 | } 656 | 657 | /** 658 | * Get value from path string 659 | * 660 | * @param {Object} obj 661 | * @param {String} path 662 | * @return value 663 | */ 664 | 665 | function getValue (obj, path) { 666 | if (!isObject(obj)) { return null } 667 | 668 | var paths = parsePath(path); 669 | if (empty(paths)) { return null } 670 | 671 | var length = paths.length; 672 | var ret = null; 673 | var last = obj; 674 | var i = 0; 675 | while (i < length) { 676 | var value = last[paths[i]]; 677 | if (value === undefined) { 678 | last = null; 679 | break 680 | } 681 | last = value; 682 | i++; 683 | } 684 | 685 | ret = last; 686 | return ret 687 | } 688 | 689 | return getValue 690 | }; 691 | 692 | /** 693 | * extend 694 | * 695 | * @param {Vue} Vue 696 | * @return {Vue} 697 | */ 698 | 699 | var Extend = function (Vue) { 700 | var format = Format(Vue); 701 | var getValue = Path(Vue); 702 | 703 | function parseArgs () { 704 | var args = [], len = arguments.length; 705 | while ( len-- ) args[ len ] = arguments[ len ]; 706 | 707 | var lang = Vue.config.lang; 708 | var fallback = Vue.config.fallbackLang; 709 | 710 | if (args.length === 1) { 711 | if (isObject(args[0]) || Array.isArray(args[0])) { 712 | args = args[0]; 713 | } else if (typeof args[0] === 'string') { 714 | lang = args[0]; 715 | } 716 | } else if (args.length === 2) { 717 | if (typeof args[0] === 'string') { 718 | lang = args[0]; 719 | } 720 | if (isObject(args[1]) || Array.isArray(args[1])) { 721 | args = args[1]; 722 | } 723 | } 724 | 725 | return { lang: lang, fallback: fallback, params: args } 726 | } 727 | 728 | function exist (locale, key) { 729 | if (!locale || !key) { return false } 730 | return !isNil(getValue(locale, key)) 731 | } 732 | 733 | function interpolate (locale, key, args) { 734 | if (!locale) { return null } 735 | 736 | var val = getValue(locale, key); 737 | if (Array.isArray(val)) { return val } 738 | if (isNil(val)) { val = locale[key]; } 739 | if (isNil(val)) { return null } 740 | if (typeof val !== 'string') { warn("Value of key '" + key + "' is not a string!"); return null } 741 | 742 | // Check for the existance of links within the translated string 743 | if (val.indexOf('@:') >= 0) { 744 | // Match all the links within the local 745 | // We are going to replace each of 746 | // them with its translation 747 | var matches = val.match(/(@:[\w|.]+)/g); 748 | for (var idx in matches) { 749 | var link = matches[idx]; 750 | // Remove the leading @: 751 | var linkPlaceholder = link.substr(2); 752 | // Translate the link 753 | var translatedstring = interpolate(locale, linkPlaceholder, args); 754 | // Replace the link with the translated string 755 | val = val.replace(link, translatedstring); 756 | } 757 | } 758 | 759 | return !args 760 | ? val 761 | : Vue.config.i18nFormatter 762 | ? Vue.config.i18nFormatter.apply(null, [val].concat(args)) 763 | : format(val, args) 764 | } 765 | 766 | function translate (getter, lang, fallback, key, params) { 767 | var res = null; 768 | res = interpolate(getter(lang), key, params); 769 | if (!isNil(res)) { return res } 770 | 771 | res = interpolate(getter(fallback), key, params); 772 | if (!isNil(res)) { 773 | { 774 | warn('Fall back to translate the keypath "' + key + '" with "' + 775 | fallback + '" language.'); 776 | } 777 | return res 778 | } else { 779 | return null 780 | } 781 | } 782 | 783 | 784 | function warnDefault (lang, key, vm, result) { 785 | if (!isNil(result)) { return result } 786 | if (Vue.config.missingHandler) { 787 | Vue.config.missingHandler.apply(null, [lang, key, vm]); 788 | } else { 789 | { 790 | warn('Cannot translate the value of keypath "' + key + '". ' + 791 | 'Use the value of keypath as default'); 792 | } 793 | } 794 | return key 795 | } 796 | 797 | function getAssetLocale (lang) { 798 | return Vue.locale(lang) 799 | } 800 | 801 | function getComponentLocale (lang) { 802 | return this.$options.locales[lang] 803 | } 804 | 805 | function getOldChoiceIndexFixed (choice) { 806 | return choice ? choice > 1 ? 1 : 0 : 1 807 | } 808 | 809 | function getChoiceIndex (choice, choicesLength) { 810 | choice = Math.abs(choice); 811 | 812 | if (choicesLength === 2) { return getOldChoiceIndexFixed(choice) } 813 | 814 | return choice ? Math.min(choice, 2) : 0 815 | } 816 | 817 | function fetchChoice (locale, choice) { 818 | if (!locale && typeof locale !== 'string') { return null } 819 | var choices = locale.split('|'); 820 | 821 | choice = getChoiceIndex(choice, choices.length); 822 | if (!choices[choice]) { return locale } 823 | return choices[choice].trim() 824 | } 825 | 826 | /** 827 | * Vue.t 828 | * 829 | * @param {String} key 830 | * @param {Array} ...args 831 | * @return {String} 832 | */ 833 | 834 | Vue.t = function (key) { 835 | var args = [], len = arguments.length - 1; 836 | while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ]; 837 | 838 | if (!key) { return '' } 839 | var ref = parseArgs.apply(void 0, args); 840 | var lang = ref.lang; 841 | var fallback = ref.fallback; 842 | var params = ref.params; 843 | return warnDefault(lang, key, null, translate(getAssetLocale, lang, fallback, key, params)) 844 | }; 845 | 846 | /** 847 | * Vue.tc 848 | * 849 | * @param {String} key 850 | * @param {number|undefined} choice 851 | * @param {Array} ...args 852 | * @return {String} 853 | */ 854 | 855 | Vue.tc = function (key, choice) { 856 | var args = [], len = arguments.length - 2; 857 | while ( len-- > 0 ) args[ len ] = arguments[ len + 2 ]; 858 | 859 | return fetchChoice(Vue.t.apply(Vue, [ key ].concat( args )), choice) 860 | }; 861 | 862 | /** 863 | * Vue.te 864 | * 865 | * @param {String} key 866 | * @param {Array} ...args 867 | * @return {Boolean} 868 | */ 869 | 870 | Vue.te = function (key) { 871 | var args = [], len = arguments.length - 1; 872 | while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ]; 873 | 874 | var ref = parseArgs.apply(void 0, args); 875 | var lang = ref.lang; 876 | return exist(getAssetLocale(lang), key) 877 | }; 878 | 879 | /** 880 | * $t 881 | * 882 | * @param {String} key 883 | * @param {Array} ...args 884 | * @return {String} 885 | */ 886 | 887 | Vue.prototype.$t = function (key) { 888 | var args = [], len = arguments.length - 1; 889 | while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ]; 890 | 891 | if (!key) { return '' } 892 | var ref = parseArgs.apply(void 0, args); 893 | var lang = ref.lang; 894 | var fallback = ref.fallback; 895 | var params = ref.params; 896 | var res = null; 897 | if (this.$options.locales) { 898 | res = translate( 899 | bind(getComponentLocale, this), lang, fallback, key, params 900 | ); 901 | if (res) { return res } 902 | } 903 | return warnDefault(lang, key, this, translate(getAssetLocale, lang, fallback, key, params)) 904 | }; 905 | 906 | /** 907 | * $tc 908 | * 909 | * @param {String} key 910 | * @param {number|undefined} choice 911 | * @param {Array} ...args 912 | * @return {String} 913 | */ 914 | 915 | Vue.prototype.$tc = function (key, choice) { 916 | var args = [], len = arguments.length - 2; 917 | while ( len-- > 0 ) args[ len ] = arguments[ len + 2 ]; 918 | 919 | if (typeof choice !== 'number' && typeof choice !== 'undefined') { 920 | return key 921 | } 922 | return fetchChoice((ref = this).$t.apply(ref, [ key ].concat( args )), choice) 923 | var ref; 924 | }; 925 | 926 | /** 927 | * $te 928 | * 929 | * @param {String} key 930 | * @param {Array} ...args 931 | * @return {Boolean} 932 | * 933 | */ 934 | 935 | Vue.prototype.$te = function (key) { 936 | var args = [], len = arguments.length - 1; 937 | while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ]; 938 | 939 | var ref = parseArgs.apply(void 0, args); 940 | var lang = ref.lang; 941 | var found = false; 942 | if (this.$options.locales) { // exist component locale 943 | found = exist(bind(getComponentLocale)(lang), key); 944 | } 945 | if (!found) { 946 | found = exist(getAssetLocale(lang), key); 947 | } 948 | return found 949 | }; 950 | 951 | Vue.mixin({ 952 | computed: { 953 | $lang: function $lang () { 954 | return Vue.config.lang 955 | } 956 | } 957 | }); 958 | 959 | return Vue 960 | }; 961 | 962 | var langVM; // singleton 963 | 964 | 965 | /** 966 | * plugin 967 | * 968 | * @param {Object} Vue 969 | * @param {Object} opts 970 | */ 971 | 972 | function plugin (Vue, opts) { 973 | if ( opts === void 0 ) opts = {}; 974 | 975 | var version = (Vue.version && Number(Vue.version.split('.')[0])) || -1; 976 | 977 | if ("development" !== 'production' && plugin.installed) { 978 | warn('already installed.'); 979 | return 980 | } 981 | 982 | if ("development" !== 'production' && version < 2) { 983 | warn(("vue-i18n (" + (plugin.version) + ") need to use Vue 2.0 or later (Vue: " + (Vue.version) + ").")); 984 | return 985 | } 986 | 987 | var lang = 'en'; 988 | setupLangVM(Vue, lang); 989 | 990 | Asset(Vue, langVM); 991 | Override(Vue, langVM); 992 | Config(Vue, langVM, lang); 993 | Extend(Vue); 994 | } 995 | 996 | function setupLangVM (Vue, lang) { 997 | var silent = Vue.config.silent; 998 | Vue.config.silent = true; 999 | if (!langVM) { 1000 | langVM = new Vue({ data: { lang: lang, locales: {} } }); 1001 | } 1002 | Vue.config.silent = silent; 1003 | } 1004 | 1005 | plugin.version = '5.0.3'; 1006 | 1007 | if (typeof window !== 'undefined' && window.Vue) { 1008 | window.Vue.use(plugin); 1009 | } 1010 | 1011 | return plugin; 1012 | 1013 | }))); 1014 | -------------------------------------------------------------------------------- /assets/js/vue.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Vue.js v2.2.6 3 | * (c) 2014-2017 Evan You 4 | * Released under the MIT License. 5 | */ 6 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Vue=t()}(this,function(){"use strict";function e(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function t(e){var t=parseFloat(e);return isNaN(t)?e:t}function n(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}function i(e,t){return $i.call(e,t)}function o(e){return"string"==typeof e||"number"==typeof e}function a(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}function s(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function c(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function u(e,t){for(var n in t)e[n]=t[n];return e}function l(e){return null!==e&&"object"==typeof e}function f(e){return ki.call(e)===Ai}function p(e){for(var t={},n=0;n=0&&co[n].id>e.id;)n--;co.splice(Math.max(n,po)+1,0,e)}else co.push(e);lo||(lo=!0,zi(de))}}function he(e){mo.clear(),me(e,mo)}function me(e,t){var n,r,i=Array.isArray(e);if((i||l(e))&&Object.isExtensible(e)){if(e.__ob__){var o=e.__ob__.dep.id;if(t.has(o))return;t.add(o)}if(i)for(n=e.length;n--;)me(e[n],t);else for(r=Object.keys(e),n=r.length;n--;)me(e[r[n]],t)}}function ge(e,t,n){go.get=function(){return this[t][n]},go.set=function(e){this[t][n]=e},Object.defineProperty(e,n,go)}function ye(e){e._watchers=[];var t=e.$options;t.props&&_e(e,t.props),t.methods&&ke(e,t.methods),t.data?be(e):k(e._data={},!0),t.computed&&we(e,t.computed),t.watch&&Ae(e,t.watch)}function _e(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[],o=!e.$parent;Qi.shouldConvert=o;for(var a in t)!function(o){i.push(o);var a=P(o,t,n,e);A(r,o,a),o in e||ge(e,"_props",o)}(a);Qi.shouldConvert=!0}function be(e){var t=e.$options.data;t=e._data="function"==typeof t?$e(t,e):t||{},f(t)||(t={});for(var n=Object.keys(t),r=e.$options.props,o=n.length;o--;)r&&i(r,n[o])||g(n[o])||ge(e,"_data",n[o]);k(t,!0)}function $e(e,t){try{return e.call(t)}catch(e){return U(e,t,"data()"),{}}}function we(e,t){var n=e._computedWatchers=Object.create(null);for(var r in t){var i=t[r],o="function"==typeof i?i:i.get;n[r]=new ho(e,o,d,yo),r in e||xe(e,r,i)}}function xe(e,t,n){"function"==typeof n?(go.get=Ce(t),go.set=d):(go.get=n.get?n.cache!==!1?Ce(t):n.get:d,go.set=n.set?n.set:d),Object.defineProperty(e,t,go)}function Ce(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),qi.target&&t.depend(),t.value}}function ke(e,t){e.$options.props;for(var n in t)e[n]=null==t[n]?d:s(t[n],e)}function Ae(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i-1:e instanceof RegExp&&e.test(t)}function ft(e,t){for(var n in e){var r=e[n];if(r){var i=ut(r.componentOptions);i&&!t(i)&&(pt(r),e[n]=null)}}}function pt(e){e&&(e.componentInstance._inactive||fe(e.componentInstance,"deactivated"),e.componentInstance.$destroy())}function dt(e){for(var t=e.data,n=e,r=e;r.componentInstance;)r=r.componentInstance._vnode,r.data&&(t=vt(r.data,t));for(;n=n.parent;)n.data&&(t=vt(t,n.data));return ht(t)}function vt(e,t){return{staticClass:mt(e.staticClass,t.staticClass),class:e.class?[e.class,t.class]:t.class}}function ht(e){var t=e.class,n=e.staticClass;return n||t?mt(n,gt(t)):""}function mt(e,t){return e?t?e+" "+t:e:t||""}function gt(e){var t="";if(!e)return t;if("string"==typeof e)return e;if(Array.isArray(e)){for(var n,r=0,i=e.length;r-1?Zo[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Zo[e]=/HTMLUnknownElement/.test(t.toString())}function bt(e){if("string"==typeof e){var t=document.querySelector(e);return t?t:document.createElement("div")}return e}function $t(e,t){var n=document.createElement(e);return"select"!==e?n:(t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)}function wt(e,t){return document.createElementNS(zo[e],t)}function xt(e){return document.createTextNode(e)}function Ct(e){return document.createComment(e)}function kt(e,t,n){e.insertBefore(t,n)}function At(e,t){e.removeChild(t)}function Ot(e,t){e.appendChild(t)}function Tt(e){return e.parentNode}function St(e){return e.nextSibling}function Et(e){return e.tagName}function jt(e,t){e.textContent=t}function Nt(e,t,n){e.setAttribute(t,n)}function It(e,t){var n=e.data.ref;if(n){var i=e.context,o=e.componentInstance||e.elm,a=i.$refs;t?Array.isArray(a[n])?r(a[n],o):a[n]===o&&(a[n]=void 0):e.data.refInFor?Array.isArray(a[n])&&a[n].indexOf(o)<0?a[n].push(o):a[n]=[o]:a[n]=o}}function Lt(e){return void 0===e||null===e}function Dt(e){return void 0!==e&&null!==e}function Mt(e){return e===!0}function Pt(e,t){return e.key===t.key&&e.tag===t.tag&&e.isComment===t.isComment&&Dt(e.data)===Dt(t.data)&&Rt(e,t)}function Rt(e,t){if("input"!==e.tag)return!0;var n;return(Dt(n=e.data)&&Dt(n=n.attrs)&&n.type)===(Dt(n=t.data)&&Dt(n=n.attrs)&&n.type)}function Ft(e,t,n){var r,i,o={};for(r=t;r<=n;++r)i=e[r].key,Dt(i)&&(o[i]=r);return o}function Ht(e,t){(e.data.directives||t.data.directives)&&Ut(e,t)}function Ut(e,t){var n,r,i,o=e===Qo,a=t===Qo,s=Bt(e.data.directives,e.context),c=Bt(t.data.directives,t.context),u=[],l=[];for(n in c)r=s[n],i=c[n],r?(i.oldValue=r.value,zt(i,"update",t,e),i.def&&i.def.componentUpdated&&l.push(i)):(zt(i,"bind",t,e),i.def&&i.def.inserted&&u.push(i));if(u.length){var f=function(){for(var n=0;n=0&&" "===(m=e.charAt(h));h--);m&&oa.test(m)||(l=!0)}}else void 0===o?(v=i+1,o=e.slice(0,i).trim()):t();if(void 0===o?o=e.slice(0,i).trim():0!==v&&t(),a)for(i=0;i=Oo}function ln(e){return 34===e||39===e}function fn(e){var t=1;for(jo=Eo;!un();)if(e=cn(),ln(e))pn(e);else if(91===e&&t++,93===e&&t--,0===t){No=Eo;break}}function pn(e){for(var t=e;!un()&&(e=cn())!==t;);}function dn(e,t,n){Io=n;var r=t.value,i=t.modifiers,o=e.tag,a=e.attrsMap.type;if("select"===o)mn(e,r,i);else if("input"===o&&"checkbox"===a)vn(e,r,i);else if("input"===o&&"radio"===a)hn(e,r,i);else if("input"===o||"textarea"===o)gn(e,r,i);else if(!Si.isReservedTag(o))return on(e,r,i),!1;return!0}function vn(e,t,n){var r=n&&n.number,i=nn(e,"value")||"null",o=nn(e,"true-value")||"true",a=nn(e,"false-value")||"false";Qt(e,"checked","Array.isArray("+t+")?_i("+t+","+i+")>-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),tn(e,sa,"var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$c){$$i<0&&("+t+"=$$a.concat($$v))}else{$$i>-1&&("+t+"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{"+t+"=$$c}",null,!0)}function hn(e,t,n){var r=n&&n.number,i=nn(e,"value")||"null";i=r?"_n("+i+")":i,Qt(e,"checked","_q("+t+","+i+")"),tn(e,sa,an(t,i),null,!0)}function mn(e,t,n){var r=n&&n.number,i='Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(r?"_n(val)":"val")+"})",o="var $$selectedVal = "+i+";";o=o+" "+an(t,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),tn(e,"change",o,null,!0)}function gn(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?aa:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=an(t,l);c&&(f="if($event.target.composing)return;"+f),Qt(e,"value","("+t+")"),tn(e,u,f,null,!0),(s||a||"number"===r)&&tn(e,"blur","$forceUpdate()")}function yn(e){var t;e[aa]&&(t=Di?"change":"input",e[t]=[].concat(e[aa],e[t]||[]),delete e[aa]),e[sa]&&(t=Hi?"click":"change",e[t]=[].concat(e[sa],e[t]||[]),delete e[sa])}function _n(e,t,n,r){if(n){var i=t,o=Lo;t=function(n){null!==(1===arguments.length?i(n):i.apply(null,arguments))&&bn(e,t,r,o)}}Lo.addEventListener(e,t,r)}function bn(e,t,n,r){(r||Lo).removeEventListener(e,t,n)}function $n(e,t){if(e.data.on||t.data.on){var n=t.data.on||{},r=e.data.on||{};Lo=t.elm,yn(n),K(n,r,_n,bn,t.context)}}function wn(e,t){if(e.data.domProps||t.data.domProps){var n,r,i=t.elm,o=e.data.domProps||{},a=t.data.domProps||{};a.__ob__&&(a=t.data.domProps=u({},a));for(n in o)null==a[n]&&(i[n]="");for(n in a)if(r=a[n],"textContent"!==n&&"innerHTML"!==n||(t.children&&(t.children.length=0),r!==o[n]))if("value"===n){i._value=r;var s=null==r?"":String(r);xn(i,t,s)&&(i.value=s)}else i[n]=r}}function xn(e,t,n){return!e.composing&&("option"===t.tag||Cn(e,n)||kn(e,n))}function Cn(e,t){return document.activeElement!==e&&e.value!==t}function kn(e,n){var r=e.value,i=e._vModifiers;return i&&i.number||"number"===e.type?t(r)!==t(n):i&&i.trim?r.trim()!==n.trim():r!==n}function An(e){var t=On(e.style);return e.staticStyle?u(e.staticStyle,t):t}function On(e){return Array.isArray(e)?p(e):"string"==typeof e?la(e):e}function Tn(e,t){var n,r={};if(t)for(var i=e;i.componentInstance;)i=i.componentInstance._vnode,i.data&&(n=An(i.data))&&u(r,n);(n=An(e.data))&&u(r,n);for(var o=e;o=o.parent;)o.data&&(n=An(o.data))&&u(r,n);return r}function Sn(e,t){var n=t.data,r=e.data;if(n.staticStyle||n.style||r.staticStyle||r.style){var i,o,a=t.elm,s=e.data.staticStyle,c=e.data.style||{},l=s||c,f=On(t.data.style)||{};t.data.style=f.__ob__?u({},f):f;var p=Tn(t,!0);for(o in l)null==p[o]&&da(a,o,"");for(o in p)(i=p[o])!==l[o]&&da(a,o,null==i?"":i)}}function En(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(/\s+/).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function jn(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(/\s+/).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t);else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");e.setAttribute("class",n.trim())}}function Nn(e){if(e){if("object"==typeof e){var t={};return e.css!==!1&&u(t,ga(e.name||"v")),u(t,e),t}return"string"==typeof e?ga(e):void 0}}function In(e){ka(function(){ka(e)})}function Ln(e,t){(e._transitionClasses||(e._transitionClasses=[])).push(t),En(e,t)}function Dn(e,t){e._transitionClasses&&r(e._transitionClasses,t),jn(e,t)}function Mn(e,t,n){var r=Pn(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===_a?wa:Ca,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c0&&(n=_a,l=a,f=o.length):t===ba?u>0&&(n=ba,l=u,f=c.length):(l=Math.max(a,u),n=l>0?a>u?_a:ba:null,f=n?n===_a?o.length:c.length:0),{type:n,timeout:l,propCount:f,hasTransform:n===_a&&Aa.test(r[$a+"Property"])}}function Rn(e,t){for(;e.length1}function zn(e,t){t.data.show||Hn(t)}function Jn(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=e.options.length;s-1,a.selected!==o&&(a.selected=o);else if(v(qn(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function Kn(e,t){for(var n=0,r=t.length;n=0&&a[i].lowerCasedTag!==s;i--);else i=0;if(i>=0){for(var c=a.length-1;c>=i;c--)t.end&&t.end(a[c].tag,n,r);a.length=i,o=i&&a[i-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,r):"p"===s&&(t.start&&t.start(e,[],!1,n,r),t.end&&t.end(e,n,r))}for(var i,o,a=[],s=t.expectHTML,c=t.isUnaryTag||Oi,u=t.canBeLeftOpenTag||Oi,l=0;e;){if(i=e,o&&ys(o)){var f=o.toLowerCase(),p=_s[f]||(_s[f]=new RegExp("([\\s\\S]*?)(]*>)","i")),d=0,v=e.replace(p,function(e,n,r){return d=r.length,ys(f)||"noscript"===f||(n=n.replace(//g,"$1").replace(//g,"$1")),t.chars&&t.chars(n),""});l+=e.length-v.length,e=v,r(f,l-d,l)}else{var h=e.indexOf("<");if(0===h){if(Ya.test(e)){var m=e.indexOf("-->");if(m>=0){n(m+3);continue}}if(Qa.test(e)){var g=e.indexOf("]>");if(g>=0){n(g+2);continue}}var y=e.match(Ga);if(y){n(y[0].length);continue}var _=e.match(Za);if(_){var b=l;n(_[0].length),r(_[1],b,l);continue}var $=function(){var t=e.match(qa);if(t){var r={tagName:t[1],attrs:[],start:l};n(t[0].length);for(var i,o;!(i=e.match(Wa))&&(o=e.match(Ja));)n(o[0].length),r.attrs.push(o);if(i)return r.unarySlash=i[1],n(i[0].length),r.end=l,r}}();if($){!function(e){var n=e.tagName,i=e.unarySlash;s&&("p"===o&&Va(n)&&r(o),u(n)&&o===n&&r(n));for(var l=c(n)||"html"===n&&"head"===o||!!i,f=e.attrs.length,p=new Array(f),d=0;d=0){for(x=e.slice(h);!(Za.test(x)||qa.test(x)||Ya.test(x)||Qa.test(x)||(C=x.indexOf("<",1))<0);)h+=C,x=e.slice(h);w=e.substring(0,h),n(h)}h<0&&(w=e,e=""),t.chars&&w&&t.chars(w)}if(e===i){t.chars&&t.chars(e);break}}r()}function ur(e,t){var n=t?Cs(t):xs;if(n.test(e)){for(var r,i,o=[],a=n.lastIndex=0;r=n.exec(e);){i=r.index,i>a&&o.push(JSON.stringify(e.slice(a,i)));var s=Wt(r[1].trim());o.push("_s("+s+")"),a=i+r[0].length}return a0,Pi=Li&&Li.indexOf("edge/")>0,Ri=Li&&Li.indexOf("android")>0,Fi=Li&&/iphone|ipad|ipod|ios/.test(Li),Hi=Li&&/chrome\/\d+/.test(Li)&&!Pi,Ui=function(){return void 0===yi&&(yi=!Ii&&"undefined"!=typeof global&&"server"===global.process.env.VUE_ENV),yi},Bi=Ii&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Vi="undefined"!=typeof Symbol&&b(Symbol)&&"undefined"!=typeof Reflect&&b(Reflect.ownKeys),zi=function(){function e(){r=!1;var e=n.slice(0);n.length=0;for(var t=0;t1?c(n):n;for(var r=c(arguments,1),i=0,o=n.length;i1&&(t[n[0].trim()]=n[1].trim())}}),t}),fa=/^--/,pa=/\s*!important$/,da=function(e,t,n){fa.test(t)?e.style.setProperty(t,n):pa.test(n)?e.style.setProperty(t,n.replace(pa,""),"important"):e.style[ha(t)]=n},va=["Webkit","Moz","ms"],ha=a(function(e){if(Do=Do||document.createElement("div"),"filter"!==(e=wi(e))&&e in Do.style)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;np?(u=Lt(n[m+1])?null:n[m+1].elm,h(e,u,n,f,m,r)):f>m&&g(e,t,l,p)}function b(e,t,n,r){if(e!==t){if(Mt(t.isStatic)&&Mt(e.isStatic)&&t.key===e.key&&(Mt(t.isCloned)||Mt(t.isOnce)))return t.elm=e.elm,void(t.componentInstance=e.componentInstance);var i,o=t.data;Dt(o)&&Dt(i=o.hook)&&Dt(i=i.prepatch)&&i(e,t);var a=t.elm=e.elm,s=e.children,c=t.children;if(Dt(o)&&p(t)){for(i=0;i',n.innerHTML.indexOf(t)>0}("\n"," "),Ua=n("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),Ba=n("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),Va=n("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),za=[/"([^"]*)"+/.source,/'([^']*)'+/.source,/([^\s"'=<>`]+)/.source],Ja=new RegExp("^\\s*"+/([^\s"'<>\/=]+)/.source+"(?:\\s*("+/(?:=)/.source+")\\s*(?:"+za.join("|")+"))?"),Ka="[a-zA-Z_][\\w\\-\\.]*",qa=new RegExp("^<((?:"+Ka+"\\:)?"+Ka+")"),Wa=/^\s*(\/?)>/,Za=new RegExp("^<\\/((?:"+Ka+"\\:)?"+Ka+")[^>]*>"),Ga=/^]+>/i,Ya=/^