zetan-cli-dev-template-vue-element-admin 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (303) hide show
  1. package/package.json +8 -0
  2. package/template/.editorconfig +14 -0
  3. package/template/.env.development +5 -0
  4. package/template/.env.production +6 -0
  5. package/template/.env.staging +8 -0
  6. package/template/.eslintignore +4 -0
  7. package/template/.eslintrc.js +198 -0
  8. package/template/.travis.yml +5 -0
  9. package/template/LICENSE +21 -0
  10. package/template/README.es.md +228 -0
  11. package/template/README.ja.md +224 -0
  12. package/template/README.md +250 -0
  13. package/template/README.zh-CN.md +273 -0
  14. package/template/babel.config.js +14 -0
  15. package/template/build/index.js +35 -0
  16. package/template/jest.config.js +24 -0
  17. package/template/jsconfig.json +9 -0
  18. package/template/mock/article.js +116 -0
  19. package/template/mock/index.js +60 -0
  20. package/template/mock/mock-server.js +81 -0
  21. package/template/mock/remote-search.js +51 -0
  22. package/template/mock/role/index.js +98 -0
  23. package/template/mock/role/routes.js +530 -0
  24. package/template/mock/user.js +84 -0
  25. package/template/mock/utils.js +48 -0
  26. package/template/package.json +111 -0
  27. package/template/plop-templates/component/index.hbs +26 -0
  28. package/template/plop-templates/component/prompt.js +55 -0
  29. package/template/plop-templates/store/index.hbs +16 -0
  30. package/template/plop-templates/store/prompt.js +62 -0
  31. package/template/plop-templates/utils.js +2 -0
  32. package/template/plop-templates/view/index.hbs +26 -0
  33. package/template/plop-templates/view/prompt.js +55 -0
  34. package/template/plopfile.js +9 -0
  35. package/template/postcss.config.js +5 -0
  36. package/template/public/favicon.ico +0 -0
  37. package/template/public/index.html +15 -0
  38. package/template/src/App.vue +11 -0
  39. package/template/src/api/article.js +41 -0
  40. package/template/src/api/qiniu.js +8 -0
  41. package/template/src/api/remote-search.js +17 -0
  42. package/template/src/api/role.js +38 -0
  43. package/template/src/api/user.js +24 -0
  44. package/template/src/assets/401_images/401.gif +0 -0
  45. package/template/src/assets/404_images/404.png +0 -0
  46. package/template/src/assets/404_images/404_cloud.png +0 -0
  47. package/template/src/assets/custom-theme/fonts/element-icons.ttf +0 -0
  48. package/template/src/assets/custom-theme/fonts/element-icons.woff +0 -0
  49. package/template/src/assets/custom-theme/index.css +1 -0
  50. package/template/src/components/BackToTop/index.vue +111 -0
  51. package/template/src/components/Breadcrumb/index.vue +82 -0
  52. package/template/src/components/Charts/Keyboard.vue +155 -0
  53. package/template/src/components/Charts/LineMarker.vue +227 -0
  54. package/template/src/components/Charts/MixChart.vue +271 -0
  55. package/template/src/components/Charts/mixins/resize.js +56 -0
  56. package/template/src/components/DndList/index.vue +166 -0
  57. package/template/src/components/DragSelect/index.vue +65 -0
  58. package/template/src/components/Dropzone/index.vue +297 -0
  59. package/template/src/components/ErrorLog/index.vue +78 -0
  60. package/template/src/components/GithubCorner/index.vue +54 -0
  61. package/template/src/components/Hamburger/index.vue +44 -0
  62. package/template/src/components/HeaderSearch/index.vue +180 -0
  63. package/template/src/components/ImageCropper/index.vue +1779 -0
  64. package/template/src/components/ImageCropper/utils/data2blob.js +19 -0
  65. package/template/src/components/ImageCropper/utils/effectRipple.js +39 -0
  66. package/template/src/components/ImageCropper/utils/language.js +232 -0
  67. package/template/src/components/ImageCropper/utils/mimes.js +7 -0
  68. package/template/src/components/JsonEditor/index.vue +77 -0
  69. package/template/src/components/Kanban/index.vue +99 -0
  70. package/template/src/components/MDinput/index.vue +360 -0
  71. package/template/src/components/MarkdownEditor/default-options.js +31 -0
  72. package/template/src/components/MarkdownEditor/index.vue +118 -0
  73. package/template/src/components/Pagination/index.vue +101 -0
  74. package/template/src/components/PanThumb/index.vue +142 -0
  75. package/template/src/components/RightPanel/index.vue +145 -0
  76. package/template/src/components/Screenfull/index.vue +60 -0
  77. package/template/src/components/Share/DropdownMenu.vue +103 -0
  78. package/template/src/components/SizeSelect/index.vue +57 -0
  79. package/template/src/components/Sticky/index.vue +91 -0
  80. package/template/src/components/SvgIcon/index.vue +62 -0
  81. package/template/src/components/TextHoverEffect/Mallki.vue +113 -0
  82. package/template/src/components/ThemePicker/index.vue +175 -0
  83. package/template/src/components/Tinymce/components/EditorImage.vue +111 -0
  84. package/template/src/components/Tinymce/dynamicLoadScript.js +59 -0
  85. package/template/src/components/Tinymce/index.vue +247 -0
  86. package/template/src/components/Tinymce/plugins.js +7 -0
  87. package/template/src/components/Tinymce/toolbar.js +6 -0
  88. package/template/src/components/Upload/SingleImage.vue +134 -0
  89. package/template/src/components/Upload/SingleImage2.vue +130 -0
  90. package/template/src/components/Upload/SingleImage3.vue +157 -0
  91. package/template/src/components/UploadExcel/index.vue +138 -0
  92. package/template/src/directive/clipboard/clipboard.js +49 -0
  93. package/template/src/directive/clipboard/index.js +13 -0
  94. package/template/src/directive/el-drag-dialog/drag.js +77 -0
  95. package/template/src/directive/el-drag-dialog/index.js +13 -0
  96. package/template/src/directive/el-table/adaptive.js +41 -0
  97. package/template/src/directive/el-table/index.js +13 -0
  98. package/template/src/directive/permission/index.js +13 -0
  99. package/template/src/directive/permission/permission.js +31 -0
  100. package/template/src/directive/sticky.js +91 -0
  101. package/template/src/directive/waves/index.js +13 -0
  102. package/template/src/directive/waves/waves.css +26 -0
  103. package/template/src/directive/waves/waves.js +72 -0
  104. package/template/src/filters/index.js +68 -0
  105. package/template/src/icons/index.js +9 -0
  106. package/template/src/icons/svg/404.svg +1 -0
  107. package/template/src/icons/svg/bug.svg +1 -0
  108. package/template/src/icons/svg/chart.svg +1 -0
  109. package/template/src/icons/svg/clipboard.svg +1 -0
  110. package/template/src/icons/svg/component.svg +1 -0
  111. package/template/src/icons/svg/dashboard.svg +1 -0
  112. package/template/src/icons/svg/documentation.svg +1 -0
  113. package/template/src/icons/svg/drag.svg +1 -0
  114. package/template/src/icons/svg/edit.svg +1 -0
  115. package/template/src/icons/svg/education.svg +1 -0
  116. package/template/src/icons/svg/email.svg +1 -0
  117. package/template/src/icons/svg/example.svg +1 -0
  118. package/template/src/icons/svg/excel.svg +1 -0
  119. package/template/src/icons/svg/exit-fullscreen.svg +1 -0
  120. package/template/src/icons/svg/eye-open.svg +1 -0
  121. package/template/src/icons/svg/eye.svg +1 -0
  122. package/template/src/icons/svg/form.svg +1 -0
  123. package/template/src/icons/svg/fullscreen.svg +1 -0
  124. package/template/src/icons/svg/guide.svg +1 -0
  125. package/template/src/icons/svg/icon.svg +1 -0
  126. package/template/src/icons/svg/international.svg +1 -0
  127. package/template/src/icons/svg/language.svg +1 -0
  128. package/template/src/icons/svg/link.svg +1 -0
  129. package/template/src/icons/svg/list.svg +1 -0
  130. package/template/src/icons/svg/lock.svg +1 -0
  131. package/template/src/icons/svg/message.svg +1 -0
  132. package/template/src/icons/svg/money.svg +1 -0
  133. package/template/src/icons/svg/nested.svg +1 -0
  134. package/template/src/icons/svg/password.svg +1 -0
  135. package/template/src/icons/svg/pdf.svg +1 -0
  136. package/template/src/icons/svg/people.svg +1 -0
  137. package/template/src/icons/svg/peoples.svg +1 -0
  138. package/template/src/icons/svg/qq.svg +1 -0
  139. package/template/src/icons/svg/search.svg +1 -0
  140. package/template/src/icons/svg/shopping.svg +1 -0
  141. package/template/src/icons/svg/size.svg +1 -0
  142. package/template/src/icons/svg/skill.svg +1 -0
  143. package/template/src/icons/svg/star.svg +1 -0
  144. package/template/src/icons/svg/tab.svg +1 -0
  145. package/template/src/icons/svg/table.svg +1 -0
  146. package/template/src/icons/svg/theme.svg +1 -0
  147. package/template/src/icons/svg/tree-table.svg +1 -0
  148. package/template/src/icons/svg/tree.svg +1 -0
  149. package/template/src/icons/svg/user.svg +1 -0
  150. package/template/src/icons/svg/wechat.svg +1 -0
  151. package/template/src/icons/svg/zip.svg +1 -0
  152. package/template/src/icons/svgo.yml +22 -0
  153. package/template/src/layout/components/AppMain.vue +57 -0
  154. package/template/src/layout/components/Navbar.vue +167 -0
  155. package/template/src/layout/components/Settings/index.vue +108 -0
  156. package/template/src/layout/components/Sidebar/FixiOSBug.js +26 -0
  157. package/template/src/layout/components/Sidebar/Item.vue +41 -0
  158. package/template/src/layout/components/Sidebar/Link.vue +43 -0
  159. package/template/src/layout/components/Sidebar/Logo.vue +82 -0
  160. package/template/src/layout/components/Sidebar/SidebarItem.vue +95 -0
  161. package/template/src/layout/components/Sidebar/index.vue +54 -0
  162. package/template/src/layout/components/TagsView/ScrollPane.vue +94 -0
  163. package/template/src/layout/components/TagsView/index.vue +292 -0
  164. package/template/src/layout/components/index.js +5 -0
  165. package/template/src/layout/index.vue +102 -0
  166. package/template/src/layout/mixin/ResizeHandler.js +45 -0
  167. package/template/src/main.js +53 -0
  168. package/template/src/permission.js +74 -0
  169. package/template/src/router/index.js +404 -0
  170. package/template/src/router/modules/charts.js +36 -0
  171. package/template/src/router/modules/components.js +102 -0
  172. package/template/src/router/modules/nested.js +66 -0
  173. package/template/src/router/modules/table.js +41 -0
  174. package/template/src/settings.js +35 -0
  175. package/template/src/store/getters.js +15 -0
  176. package/template/src/store/index.js +25 -0
  177. package/template/src/store/modules/app.js +56 -0
  178. package/template/src/store/modules/errorLog.js +28 -0
  179. package/template/src/store/modules/permission.js +69 -0
  180. package/template/src/store/modules/settings.js +35 -0
  181. package/template/src/store/modules/tagsView.js +160 -0
  182. package/template/src/store/modules/user.js +131 -0
  183. package/template/src/styles/btn.scss +99 -0
  184. package/template/src/styles/element-ui.scss +84 -0
  185. package/template/src/styles/element-variables.scss +31 -0
  186. package/template/src/styles/index.scss +191 -0
  187. package/template/src/styles/mixin.scss +66 -0
  188. package/template/src/styles/sidebar.scss +226 -0
  189. package/template/src/styles/transition.scss +48 -0
  190. package/template/src/styles/variables.scss +35 -0
  191. package/template/src/utils/auth.js +15 -0
  192. package/template/src/utils/clipboard.js +32 -0
  193. package/template/src/utils/error-log.js +35 -0
  194. package/template/src/utils/get-page-title.js +10 -0
  195. package/template/src/utils/index.js +357 -0
  196. package/template/src/utils/open-window.js +25 -0
  197. package/template/src/utils/permission.js +21 -0
  198. package/template/src/utils/request.js +85 -0
  199. package/template/src/utils/scroll-to.js +58 -0
  200. package/template/src/utils/validate.js +87 -0
  201. package/template/src/vendor/Export2Excel.js +220 -0
  202. package/template/src/vendor/Export2Zip.js +24 -0
  203. package/template/src/views/charts/keyboard.vue +23 -0
  204. package/template/src/views/charts/line.vue +23 -0
  205. package/template/src/views/charts/mix-chart.vue +23 -0
  206. package/template/src/views/clipboard/index.vue +49 -0
  207. package/template/src/views/components-demo/avatar-upload.vue +61 -0
  208. package/template/src/views/components-demo/back-to-top.vue +154 -0
  209. package/template/src/views/components-demo/count-to.vue +218 -0
  210. package/template/src/views/components-demo/dnd-list.vue +39 -0
  211. package/template/src/views/components-demo/drag-dialog.vue +61 -0
  212. package/template/src/views/components-demo/drag-kanban.vue +66 -0
  213. package/template/src/views/components-demo/drag-select.vue +43 -0
  214. package/template/src/views/components-demo/dropzone.vue +31 -0
  215. package/template/src/views/components-demo/json-editor.vue +36 -0
  216. package/template/src/views/components-demo/markdown.vue +101 -0
  217. package/template/src/views/components-demo/mixin.vue +169 -0
  218. package/template/src/views/components-demo/split-pane.vue +67 -0
  219. package/template/src/views/components-demo/sticky.vue +135 -0
  220. package/template/src/views/components-demo/tinymce.vue +36 -0
  221. package/template/src/views/dashboard/admin/components/BarChart.vue +102 -0
  222. package/template/src/views/dashboard/admin/components/BoxCard.vue +118 -0
  223. package/template/src/views/dashboard/admin/components/LineChart.vue +135 -0
  224. package/template/src/views/dashboard/admin/components/PanelGroup.vue +181 -0
  225. package/template/src/views/dashboard/admin/components/PieChart.vue +79 -0
  226. package/template/src/views/dashboard/admin/components/RaddarChart.vue +116 -0
  227. package/template/src/views/dashboard/admin/components/TodoList/Todo.vue +81 -0
  228. package/template/src/views/dashboard/admin/components/TodoList/index.scss +320 -0
  229. package/template/src/views/dashboard/admin/components/TodoList/index.vue +127 -0
  230. package/template/src/views/dashboard/admin/components/TransactionTable.vue +55 -0
  231. package/template/src/views/dashboard/admin/components/mixins/resize.js +55 -0
  232. package/template/src/views/dashboard/admin/index.vue +124 -0
  233. package/template/src/views/dashboard/editor/index.vue +74 -0
  234. package/template/src/views/dashboard/index.vue +31 -0
  235. package/template/src/views/documentation/index.vue +57 -0
  236. package/template/src/views/error-log/components/ErrorTestA.vue +13 -0
  237. package/template/src/views/error-log/components/ErrorTestB.vue +11 -0
  238. package/template/src/views/error-log/index.vue +32 -0
  239. package/template/src/views/error-page/401.vue +99 -0
  240. package/template/src/views/error-page/404.vue +228 -0
  241. package/template/src/views/example/components/ArticleDetail.vue +289 -0
  242. package/template/src/views/example/components/Dropdown/Comment.vue +41 -0
  243. package/template/src/views/example/components/Dropdown/Platform.vue +46 -0
  244. package/template/src/views/example/components/Dropdown/SourceUrl.vue +38 -0
  245. package/template/src/views/example/components/Dropdown/index.js +3 -0
  246. package/template/src/views/example/components/Warning.vue +13 -0
  247. package/template/src/views/example/create.vue +13 -0
  248. package/template/src/views/example/edit.vue +13 -0
  249. package/template/src/views/example/list.vue +112 -0
  250. package/template/src/views/excel/components/AutoWidthOption.vue +34 -0
  251. package/template/src/views/excel/components/BookTypeOption.vue +39 -0
  252. package/template/src/views/excel/components/FilenameOption.vue +27 -0
  253. package/template/src/views/excel/export-excel.vue +116 -0
  254. package/template/src/views/excel/merge-header.vue +101 -0
  255. package/template/src/views/excel/select-excel.vue +107 -0
  256. package/template/src/views/excel/upload-excel.vue +42 -0
  257. package/template/src/views/guide/index.vue +36 -0
  258. package/template/src/views/guide/steps.js +53 -0
  259. package/template/src/views/icons/element-icons.js +3 -0
  260. package/template/src/views/icons/index.vue +101 -0
  261. package/template/src/views/icons/svg-icons.js +10 -0
  262. package/template/src/views/login/auth-redirect.vue +15 -0
  263. package/template/src/views/login/components/SocialSignin.vue +72 -0
  264. package/template/src/views/login/index.vue +324 -0
  265. package/template/src/views/nested/menu1/index.vue +7 -0
  266. package/template/src/views/nested/menu1/menu1-1/index.vue +7 -0
  267. package/template/src/views/nested/menu1/menu1-2/index.vue +7 -0
  268. package/template/src/views/nested/menu1/menu1-2/menu1-2-1/index.vue +5 -0
  269. package/template/src/views/nested/menu1/menu1-2/menu1-2-2/index.vue +5 -0
  270. package/template/src/views/nested/menu1/menu1-3/index.vue +5 -0
  271. package/template/src/views/nested/menu2/index.vue +5 -0
  272. package/template/src/views/pdf/content.js +58 -0
  273. package/template/src/views/pdf/download.vue +201 -0
  274. package/template/src/views/pdf/index.vue +13 -0
  275. package/template/src/views/permission/components/SwitchRoles.vue +32 -0
  276. package/template/src/views/permission/directive.vue +111 -0
  277. package/template/src/views/permission/page.vue +19 -0
  278. package/template/src/views/permission/role.vue +270 -0
  279. package/template/src/views/profile/components/Account.vue +38 -0
  280. package/template/src/views/profile/components/Activity.vue +185 -0
  281. package/template/src/views/profile/components/Timeline.vue +43 -0
  282. package/template/src/views/profile/components/UserCard.vue +134 -0
  283. package/template/src/views/profile/index.vue +68 -0
  284. package/template/src/views/qiniu/upload.vue +41 -0
  285. package/template/src/views/redirect/index.vue +12 -0
  286. package/template/src/views/tab/components/TabPane.vue +103 -0
  287. package/template/src/views/tab/index.vue +57 -0
  288. package/template/src/views/table/complex-table.vue +379 -0
  289. package/template/src/views/table/drag-table.vue +153 -0
  290. package/template/src/views/table/dynamic-table/components/FixedThead.vue +62 -0
  291. package/template/src/views/table/dynamic-table/components/UnfixedThead.vue +50 -0
  292. package/template/src/views/table/dynamic-table/index.vue +24 -0
  293. package/template/src/views/table/inline-edit-table.vue +149 -0
  294. package/template/src/views/theme/index.vue +120 -0
  295. package/template/src/views/zip/index.vue +77 -0
  296. package/template/tests/unit/.eslintrc.js +5 -0
  297. package/template/tests/unit/components/Hamburger.spec.js +18 -0
  298. package/template/tests/unit/components/SvgIcon.spec.js +22 -0
  299. package/template/tests/unit/utils/formatTime.spec.js +29 -0
  300. package/template/tests/unit/utils/param2Obj.spec.js +14 -0
  301. package/template/tests/unit/utils/parseTime.spec.js +37 -0
  302. package/template/tests/unit/utils/validate.spec.js +28 -0
  303. package/template/vue.config.js +124 -0
@@ -0,0 +1,324 @@
1
+ <template>
2
+ <div class="login-container">
3
+ <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" autocomplete="on" label-position="left">
4
+
5
+ <div class="title-container">
6
+ <h3 class="title">Login Form</h3>
7
+ </div>
8
+
9
+ <el-form-item prop="username">
10
+ <span class="svg-container">
11
+ <svg-icon icon-class="user" />
12
+ </span>
13
+ <el-input
14
+ ref="username"
15
+ v-model="loginForm.username"
16
+ placeholder="Username"
17
+ name="username"
18
+ type="text"
19
+ tabindex="1"
20
+ autocomplete="on"
21
+ />
22
+ </el-form-item>
23
+
24
+ <el-tooltip v-model="capsTooltip" content="Caps lock is On" placement="right" manual>
25
+ <el-form-item prop="password">
26
+ <span class="svg-container">
27
+ <svg-icon icon-class="password" />
28
+ </span>
29
+ <el-input
30
+ :key="passwordType"
31
+ ref="password"
32
+ v-model="loginForm.password"
33
+ :type="passwordType"
34
+ placeholder="Password"
35
+ name="password"
36
+ tabindex="2"
37
+ autocomplete="on"
38
+ @keyup.native="checkCapslock"
39
+ @blur="capsTooltip = false"
40
+ @keyup.enter.native="handleLogin"
41
+ />
42
+ <span class="show-pwd" @click="showPwd">
43
+ <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
44
+ </span>
45
+ </el-form-item>
46
+ </el-tooltip>
47
+
48
+ <el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">Login</el-button>
49
+
50
+ <div style="position:relative">
51
+ <div class="tips">
52
+ <span>Username : admin</span>
53
+ <span>Password : any</span>
54
+ </div>
55
+ <div class="tips">
56
+ <span style="margin-right:18px;">Username : editor</span>
57
+ <span>Password : any</span>
58
+ </div>
59
+
60
+ <el-button class="thirdparty-button" type="primary" @click="showDialog=true">
61
+ Or connect with
62
+ </el-button>
63
+ </div>
64
+ </el-form>
65
+
66
+ <el-dialog title="Or connect with" :visible.sync="showDialog">
67
+ Can not be simulated on local, so please combine you own business simulation! ! !
68
+ <br>
69
+ <br>
70
+ <br>
71
+ <social-sign />
72
+ </el-dialog>
73
+ </div>
74
+ </template>
75
+
76
+ <script>
77
+ import { validUsername } from '@/utils/validate'
78
+ import SocialSign from './components/SocialSignin'
79
+
80
+ export default {
81
+ name: 'Login',
82
+ components: { SocialSign },
83
+ data() {
84
+ const validateUsername = (rule, value, callback) => {
85
+ if (!validUsername(value)) {
86
+ callback(new Error('Please enter the correct user name'))
87
+ } else {
88
+ callback()
89
+ }
90
+ }
91
+ const validatePassword = (rule, value, callback) => {
92
+ if (value.length < 6) {
93
+ callback(new Error('The password can not be less than 6 digits'))
94
+ } else {
95
+ callback()
96
+ }
97
+ }
98
+ return {
99
+ loginForm: {
100
+ username: 'admin',
101
+ password: '111111'
102
+ },
103
+ loginRules: {
104
+ username: [{ required: true, trigger: 'blur', validator: validateUsername }],
105
+ password: [{ required: true, trigger: 'blur', validator: validatePassword }]
106
+ },
107
+ passwordType: 'password',
108
+ capsTooltip: false,
109
+ loading: false,
110
+ showDialog: false,
111
+ redirect: undefined,
112
+ otherQuery: {}
113
+ }
114
+ },
115
+ watch: {
116
+ $route: {
117
+ handler: function(route) {
118
+ const query = route.query
119
+ if (query) {
120
+ this.redirect = query.redirect
121
+ this.otherQuery = this.getOtherQuery(query)
122
+ }
123
+ },
124
+ immediate: true
125
+ }
126
+ },
127
+ created() {
128
+ // window.addEventListener('storage', this.afterQRScan)
129
+ },
130
+ mounted() {
131
+ if (this.loginForm.username === '') {
132
+ this.$refs.username.focus()
133
+ } else if (this.loginForm.password === '') {
134
+ this.$refs.password.focus()
135
+ }
136
+ },
137
+ destroyed() {
138
+ // window.removeEventListener('storage', this.afterQRScan)
139
+ },
140
+ methods: {
141
+ checkCapslock(e) {
142
+ const { key } = e
143
+ this.capsTooltip = key && key.length === 1 && (key >= 'A' && key <= 'Z')
144
+ },
145
+ showPwd() {
146
+ if (this.passwordType === 'password') {
147
+ this.passwordType = ''
148
+ } else {
149
+ this.passwordType = 'password'
150
+ }
151
+ this.$nextTick(() => {
152
+ this.$refs.password.focus()
153
+ })
154
+ },
155
+ handleLogin() {
156
+ this.$refs.loginForm.validate(valid => {
157
+ if (valid) {
158
+ this.loading = true
159
+ this.$store.dispatch('user/login', this.loginForm)
160
+ .then(() => {
161
+ this.$router.push({ path: this.redirect || '/', query: this.otherQuery })
162
+ this.loading = false
163
+ })
164
+ .catch(() => {
165
+ this.loading = false
166
+ })
167
+ } else {
168
+ console.log('error submit!!')
169
+ return false
170
+ }
171
+ })
172
+ },
173
+ getOtherQuery(query) {
174
+ return Object.keys(query).reduce((acc, cur) => {
175
+ if (cur !== 'redirect') {
176
+ acc[cur] = query[cur]
177
+ }
178
+ return acc
179
+ }, {})
180
+ }
181
+ // afterQRScan() {
182
+ // if (e.key === 'x-admin-oauth-code') {
183
+ // const code = getQueryObject(e.newValue)
184
+ // const codeMap = {
185
+ // wechat: 'code',
186
+ // tencent: 'code'
187
+ // }
188
+ // const type = codeMap[this.auth_type]
189
+ // const codeName = code[type]
190
+ // if (codeName) {
191
+ // this.$store.dispatch('LoginByThirdparty', codeName).then(() => {
192
+ // this.$router.push({ path: this.redirect || '/' })
193
+ // })
194
+ // } else {
195
+ // alert('第三方登录失败')
196
+ // }
197
+ // }
198
+ // }
199
+ }
200
+ }
201
+ </script>
202
+
203
+ <style lang="scss">
204
+ /* 修复input 背景不协调 和光标变色 */
205
+ /* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
206
+
207
+ $bg:#283443;
208
+ $light_gray:#fff;
209
+ $cursor: #fff;
210
+
211
+ @supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
212
+ .login-container .el-input input {
213
+ color: $cursor;
214
+ }
215
+ }
216
+
217
+ /* reset element-ui css */
218
+ .login-container {
219
+ .el-input {
220
+ display: inline-block;
221
+ height: 47px;
222
+ width: 85%;
223
+
224
+ input {
225
+ background: transparent;
226
+ border: 0px;
227
+ -webkit-appearance: none;
228
+ border-radius: 0px;
229
+ padding: 12px 5px 12px 15px;
230
+ color: $light_gray;
231
+ height: 47px;
232
+ caret-color: $cursor;
233
+
234
+ &:-webkit-autofill {
235
+ box-shadow: 0 0 0px 1000px $bg inset !important;
236
+ -webkit-text-fill-color: $cursor !important;
237
+ }
238
+ }
239
+ }
240
+
241
+ .el-form-item {
242
+ border: 1px solid rgba(255, 255, 255, 0.1);
243
+ background: rgba(0, 0, 0, 0.1);
244
+ border-radius: 5px;
245
+ color: #454545;
246
+ }
247
+ }
248
+ </style>
249
+
250
+ <style lang="scss" scoped>
251
+ $bg:#2d3a4b;
252
+ $dark_gray:#889aa4;
253
+ $light_gray:#eee;
254
+
255
+ .login-container {
256
+ min-height: 100%;
257
+ width: 100%;
258
+ background-color: $bg;
259
+ overflow: hidden;
260
+
261
+ .login-form {
262
+ position: relative;
263
+ width: 520px;
264
+ max-width: 100%;
265
+ padding: 160px 35px 0;
266
+ margin: 0 auto;
267
+ overflow: hidden;
268
+ }
269
+
270
+ .tips {
271
+ font-size: 14px;
272
+ color: #fff;
273
+ margin-bottom: 10px;
274
+
275
+ span {
276
+ &:first-of-type {
277
+ margin-right: 16px;
278
+ }
279
+ }
280
+ }
281
+
282
+ .svg-container {
283
+ padding: 6px 5px 6px 15px;
284
+ color: $dark_gray;
285
+ vertical-align: middle;
286
+ width: 30px;
287
+ display: inline-block;
288
+ }
289
+
290
+ .title-container {
291
+ position: relative;
292
+
293
+ .title {
294
+ font-size: 26px;
295
+ color: $light_gray;
296
+ margin: 0px auto 40px auto;
297
+ text-align: center;
298
+ font-weight: bold;
299
+ }
300
+ }
301
+
302
+ .show-pwd {
303
+ position: absolute;
304
+ right: 10px;
305
+ top: 7px;
306
+ font-size: 16px;
307
+ color: $dark_gray;
308
+ cursor: pointer;
309
+ user-select: none;
310
+ }
311
+
312
+ .thirdparty-button {
313
+ position: absolute;
314
+ right: 0;
315
+ bottom: 6px;
316
+ }
317
+
318
+ @media only screen and (max-width: 470px) {
319
+ .thirdparty-button {
320
+ display: none;
321
+ }
322
+ }
323
+ }
324
+ </style>
@@ -0,0 +1,7 @@
1
+ <template>
2
+ <div style="padding:30px;">
3
+ <el-alert :closable="false" title="menu 1">
4
+ <router-view />
5
+ </el-alert>
6
+ </div>
7
+ </template>
@@ -0,0 +1,7 @@
1
+ <template>
2
+ <div style="padding:30px;">
3
+ <el-alert :closable="false" title="menu 1-1" type="success">
4
+ <router-view />
5
+ </el-alert>
6
+ </div>
7
+ </template>
@@ -0,0 +1,7 @@
1
+ <template>
2
+ <div style="padding:30px;">
3
+ <el-alert :closable="false" title="menu 1-2" type="success">
4
+ <router-view />
5
+ </el-alert>
6
+ </div>
7
+ </template>
@@ -0,0 +1,5 @@
1
+ <template functional>
2
+ <div style="padding:30px;">
3
+ <el-alert :closable="false" title="menu 1-2-1" type="warning" />
4
+ </div>
5
+ </template>
@@ -0,0 +1,5 @@
1
+ <template functional>
2
+ <div style="padding:30px;">
3
+ <el-alert :closable="false" title="menu 1-2-2" type="warning" />
4
+ </div>
5
+ </template>
@@ -0,0 +1,5 @@
1
+ <template functional>
2
+ <div style="padding:30px;">
3
+ <el-alert :closable="false" title="menu 1-3" type="success" />
4
+ </div>
5
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <div style="padding:30px;">
3
+ <el-alert :closable="false" title="menu 2" />
4
+ </div>
5
+ </template>
@@ -0,0 +1,58 @@
1
+ const title = 'Plans for the Next Iteration of Vue.js'
2
+
3
+ const content = `<p>Last week at<a href="https://vuejs.london/summary" rel="nofollow">Vue.js London</a>I gave a brief sneak peek of what’s coming in the next major version of Vue. This post provides an in-depth overview of the plan.</p>
4
+ <p><img class=" wscnph" src="https://wpimg.wallstcn.com/b8a1d7be-0b73-41b8-be8c-7c01c93cab66.png" data-wscntype="image" data-wscnh="742" data-wscnw="692" /></p>
5
+ <h3>Why a new majorversion?</h3>
6
+ <p>Vue 2.0 was released<a href="https://medium.com/the-vue-point/vue-2-0-is-here-ef1f26acf4b8" rel="nofollow">exactly two years ago</a>(how time flies!). During this period, the core has remained backwards compatible with five minor releases. We’ve accumulated a number of ideas that would bring improvements, but they were held off because they would result in breaking changes. At the same time, the JavaScript ecosystem and the language itself has been evolving rapidly. There are greatly improved tools that could enhance our workflow, and many new language features that could unlock simpler, more complete, and more efficient solutions to the problems Vue is trying to solve. What’s more exciting is that we are seeing ES2015 support becoming a baseline for all major evergreen browsers. Vue 3.0 aims to leverage these new language features to make Vue core smaller, faster, and more powerful.</p>
7
+ <p>Vue 3.0 is currently in prototyping phase, and we have already implemented a runtime close to feature-parity with 2.x.<strong>Many of the items listed below are either already implemented, or confirmed to be feasible. Ones that are not yet implemented or still in exploration phase are marked with a *.</strong></p>
8
+ <h3>The Details</h3>
9
+ <h4>High-Level APIChanges</h4>
10
+ <blockquote>TL;DR: Everything except render function API and scoped-slots syntax will either remain the same or can be made 2.x compatible via a compatibility build.</blockquote>
11
+ <p>Since it’s a new major, there is going to be some breaking changes. However, we take backwards compatibility seriously, so we want to start communicating these changes as soon as possible. Here’s the currently planned public API changes:</p>
12
+ <ul><li>Template syntax will remain 99% the same. There may be small tweaks in scoped slots syntax, but other than that we have no plans to change anything else for templates.</li><li>3.0 will support class-based components natively, with the aim to provide an API that is pleasant to use in native ES2015 without requiring any transpilation or stage-x features. Most current options will have a reasonable mapping in the class-based API. Stage-x features such as class fields and decorators can still be used optionally to enhance the authoring experience. In addition, the API is designed with TypeScript type inference in mind. The 3.x codebase will itself be written in TypeScript, and providing improved TypeScript support. (That said, usage of TypeScript in an application is still entirely optional.)</li><li>The 2.x object-based component format will still be supported by internally transforming the object to a corresponding class.</li><li>Mixins will still be supported.*</li><li>Top level APIs will likely receive an overhaul to avoid globally mutating the Vue runtime when installing plugins. Instead, plugins will be applied and scoped to a component tree. This will make it easier to test components that rely on specific plugins, and also make it possible to mount multiple Vue applications on the same page with different plugins, but using the same Vue runtime.*</li><li>Functional components can finally be plain functions —however, async components will now need to be explicitly created via a helper function.</li><li>The part that will receive the most changes is the Virtual DOM format used in render functions. We are currently collecting feedback from major library authors and will be sharing more details as we are more confident of the changes, but as long as you don’t heavily rely on hand-written (non-JSX) render functions in your app, upgrading should be a reasonably straightforward process.</li></ul>
13
+ <h4>Source Code Architecture</h4>
14
+ <blockquote>TL;DR: better decoupled internal modules, TypeScript, and a codebase that is easier to contribute to.</blockquote>
15
+ <p>We are re-writing 3.0 from the ground up for a cleaner and more maintainable architecture, in particular trying to make it easier to contribute to. We are breaking some internal functionalities into individual packages in order to isolate the scope of complexity. For example, the observer module will become its own package, with its own public API and tests. Note this does not affect framework-level API— you will not have to manually import individual bits from multiple packages in order to use Vue. Instead, the final Vue package is assembled using these internal packages.</p>
16
+ <p>The codebase is also now written in TypeScript. Although this will make proficiency in TypeScript a pre-requisite for contributing to the new codebase, we believe the type information and IDE support will actually make it easier for a new contributor to make meaningful contributions.</p>
17
+ <p>Decoupling the observer and scheduler into separate packages also allows us to easily experiment with alternative implementations of these parts. For example, we can implement an IE11 compatible observer implementation with the same API, or an alternative scheduler that leverages<code>requestIdleCallback</code>to yield to the browser during long updates.*</p>
18
+ <p><img class=" wscnph" src="https://wpimg.wallstcn.com/4d0b5fb2-d7f9-48fd-8f1b-03362b534dd9.png" data-wscntype="image" data-wscnh="716" data-wscnw="460" /></p>
19
+ <h4>Observation Mechanism</h4>
20
+ <blockquote>TL;DR: more complete, precise, efficient and debuggable reactivity tracking &amp; API for creating observables.</blockquote>
21
+ <p>3.0 will ship with a Proxy-based observer implementation that provides reactivity tracking with full language coverage. This eliminates a number of limitations of Vue 2’s current implementation based on<code>Object.defineProperty</code>:</p>
22
+ <p>The new observer also features the following:</p>
23
+ <p>Easily understand why a component is re-rendering</p>
24
+ <p><img class=" wscnph" src="https://wpimg.wallstcn.com/a0c9d811-1ef9-4628-8976-f7c1aaa66da0.png" data-wscntype="image" data-wscnh="540" data-wscnw="789" /></p>
25
+ <h4>Other Runtime Improvements</h4>
26
+ <blockquote>TL;DR: smaller, faster, tree-shakable features, fragments &amp; portals, custom renderer API.</blockquote>
27
+ <h4>Compiler Improvements*</h4>
28
+ <blockquote>TL;DR: tree-shaking friendly output, more AOT optimizations, parser with better error info and source map support.</blockquote>
29
+ <h4>IE11 Support*</h4>
30
+ <blockquote>TL;DR: it will be supported, but in a separate build with the same reactivity limitations of Vue 2.x.</blockquote>
31
+ <p>The new codebase currently targets evergreen browsers only and assumes baseline native ES2015 support. But alas, we know a lot of our users still need to support IE11 for the foreseeable future. Most of the ES2015 features used can be transpiled / polyfilled for IE11, with the exception for Proxies. Our plan is to implement an alternative observer with the same API, but using the good old ES5<code>Object.defineProperty</code>API. A separate build of Vue 3.x will be distributed using this observer implementation. However, this build will be subject to the same change detection caveats of Vue 2.x and thus not fully compatible with the “modern” build of 3.x. We are aware that this imposes some inconvenience for library authors as they will need to be aware of compatibility for two different builds, but we will make sure to provide clear guidelines on this when we reach that stage.</p>
32
+ <h3>How Do We GetThere</h3>
33
+ <p>First of all, although we are announcing it today, we do not have a definitive timeline yet. What we do know at the moment is the steps we will be taking to get there:</p>
34
+ <h4>1. Internal Feedback for the Runtime Prototype</h4>
35
+ <p>This is the phase we are in right now. Currently, we already have a working runtime prototype that includes the new observer, Virtual DOM and component implementation. We have invited a group of authors of influential community projects to provide feedback for the internal changes, and would like to make sure they are comfortable with the changes before moving forward. We want to ensure that important libraries in the ecosystem will be ready at the same time when we release 3.0, so that users relying on those projects can upgrade easily.</p>
36
+ <h4>2. Public Feedback viaRFCs</h4>
37
+ <p>Once we gain a certain level of confidence in the new design, for each breaking change we will be opening a dedicated RFC issue which includes:</p>
38
+ <p>We will anticipate public feedback from the wider community to help us consolidate these ideas.</p>
39
+ <h4>3. Introduce Compatible Features in 2.x &amp;2.x-next</h4>
40
+ <p>We are not forgetting about 2.x! In fact, we plan to use 2.x to progressively accustom users to the new changes. We will be gradually introducing confirmed API changes into 2.x via opt-in adaptors, and 2.x-next will allow users to try out the new Proxy-based observer.</p>
41
+ <p>The last minor release in 2.x will become LTS and continue to receive bug and security fixes for 18 months when 3.0 is released.</p>
42
+ <h4>4. AlphaPhase</h4>
43
+ <p>Next, we will finish up the compiler and server-side rendering parts of 3.0 and start making alpha releases. These will mostly be for stability testing purposes in small greenfield apps.</p>
44
+ <h4>5. BetaPhase</h4>
45
+ <p>During beta phase, our main goal is updating support libraries and tools like Vue Router, Vuex, Vue CLI, Vue DevTools and make sure they work smoothly with the new core. We will also be working with major library authors from the community to help them get ready for 3.0.</p>
46
+ <h4>6. RCPhase</h4>
47
+ <p>Once we consider the API and codebase stable, we will enter RC phase with API freeze. During this phase we will also work on a “compat build”: a build of 3.0 that includes compatibility layers for 2.x API. This build will also ship with a flag you can turn on to emit deprecation warnings for 2.x API usage in your app. The compat build can be used as a guide to upgrade your app to 3.0.</p>
48
+ <h4>7. IE11build</h4>
49
+ <p>The last task before the final release will be the IE11 compatibility build as mentioned above.</p>
50
+ <h4>8. FinalRelease</h4>
51
+ <p>In all honesty, we don’t know when this will happen yet, but likely in 2019. Again, we care more about shipping something that is solid and stable rather than hitting specific dates. There is a lot of work to be done, but we are excited for what’s coming next!</p>`
52
+
53
+ const data = {
54
+ title,
55
+ content
56
+ }
57
+
58
+ export default data
@@ -0,0 +1,201 @@
1
+ <template>
2
+ <div v-loading.fullscreen.lock="fullscreenLoading" class="main-article" element-loading-text="Efforts to generate PDF">
3
+ <div class="article__heading">
4
+ <div class="article__heading__title">
5
+ {{ article.title }}
6
+ </div>
7
+ </div>
8
+ <div style="color: #ccc;">
9
+ This article is from Evan You on <a target="_blank" href="https://medium.com/the-vue-point/plans-for-the-next-iteration-of-vue-js-777ffea6fabf">medium</a>
10
+ </div>
11
+ <div ref="content" class="node-article-content" v-html="article.content" />
12
+ </div>
13
+ </template>
14
+
15
+ <script>
16
+
17
+ export default {
18
+ data() {
19
+ return {
20
+ article: '',
21
+ fullscreenLoading: true
22
+ }
23
+ },
24
+ mounted() {
25
+ this.fetchData()
26
+ },
27
+ methods: {
28
+ fetchData() {
29
+ import('./content.js').then(data => {
30
+ const { title } = data.default
31
+ document.title = title
32
+ this.article = data.default
33
+ setTimeout(() => {
34
+ this.fullscreenLoading = false
35
+ this.$nextTick(() => {
36
+ window.print()
37
+ })
38
+ }, 3000)
39
+ })
40
+ }
41
+ }
42
+ }
43
+ </script>
44
+
45
+ <style lang="scss">
46
+ @mixin clearfix {
47
+ &:before {
48
+ display: table;
49
+ content: '';
50
+ clear: both;
51
+ }
52
+
53
+ &:after {
54
+ display: table;
55
+ content: '';
56
+ clear: both;
57
+ }
58
+ }
59
+
60
+ .main-article {
61
+ padding: 20px;
62
+ margin: 0 auto;
63
+ display: block;
64
+ width: 740px;
65
+ background: #fff;
66
+ }
67
+
68
+ .article__heading {
69
+ position: relative;
70
+ padding: 0 0 20px;
71
+ overflow: hidden;
72
+ }
73
+
74
+ .article__heading__title {
75
+ display: block;
76
+ display: -webkit-box;
77
+ -webkit-box-orient: vertical;
78
+ -webkit-line-clamp: 2;
79
+ line-clamp: 2;
80
+ word-wrap: break-word;
81
+ overflow-wrap: break-word;
82
+ font-size: 32px;
83
+ line-height: 48px;
84
+ font-weight: 600;
85
+ color: #333;
86
+ overflow: hidden;
87
+ }
88
+
89
+ .node-article-content {
90
+ margin: 20px 0 0;
91
+ @include clearfix;
92
+ font-size: 16px;
93
+ color: #333;
94
+ letter-spacing: 0.5px;
95
+ line-height: 28px;
96
+ margin-bottom: 30px;
97
+ font-family: medium-content-serif-font, Georgia, Cambria, "Times New Roman", Times, serif;
98
+
99
+ &> :last-child {
100
+ margin-bottom: 0;
101
+ }
102
+
103
+ b,
104
+ strong {
105
+ font-weight: inherit;
106
+ font-weight: bolder;
107
+ }
108
+
109
+ img {
110
+ max-width: 100%;
111
+ display: block;
112
+ margin: 0 auto;
113
+ }
114
+
115
+ p {
116
+ font-weight: 400;
117
+ font-style: normal;
118
+ font-size: 21px;
119
+ line-height: 1.58;
120
+ letter-spacing: -.003em;
121
+
122
+ }
123
+
124
+ ul {
125
+ margin-bottom: 30px;
126
+ }
127
+
128
+ li {
129
+ --x-height-multiplier: 0.375;
130
+ --baseline-multiplier: 0.17;
131
+
132
+ letter-spacing: .01rem;
133
+ font-weight: 400;
134
+ font-style: normal;
135
+ font-size: 21px;
136
+ line-height: 1.58;
137
+ letter-spacing: -.003em;
138
+ margin-left: 30px;
139
+ margin-bottom: 14px;
140
+ }
141
+
142
+ a {
143
+ text-decoration: none;
144
+ background-repeat: repeat-x;
145
+ background-image: linear-gradient(to right, rgba(0, 0, 0, .84) 100%, rgba(0, 0, 0, 0) 0);
146
+ background-size: 1px 1px;
147
+ background-position: 0 calc(1em + 1px);
148
+ padding: 0 6px;
149
+ }
150
+
151
+ code {
152
+ background: rgba(0, 0, 0, .05);
153
+ padding: 3px 4px;
154
+ margin: 0 2px;
155
+ font-size: 16px;
156
+ display: inline-block;
157
+ }
158
+
159
+ img {
160
+ border: 0;
161
+ }
162
+
163
+ /* 解决 IE6-7 图片缩放锯齿问题 */
164
+ img {
165
+ -ms-interpolation-mode: bicubic;
166
+ }
167
+
168
+ blockquote {
169
+ --x-height-multiplier: 0.375;
170
+ --baseline-multiplier: 0.17;
171
+ font-family: medium-content-serif-font, Georgia, Cambria, "Times New Roman", Times, serif;
172
+ letter-spacing: .01rem;
173
+ font-weight: 400;
174
+ font-style: italic;
175
+ font-size: 21px;
176
+ line-height: 1.58;
177
+ letter-spacing: -.003em;
178
+ border-left: 3px solid rgba(0, 0, 0, .84);
179
+ padding-left: 20px;
180
+ margin-left: -23px;
181
+ padding-bottom: 2px;
182
+ }
183
+
184
+ a {
185
+ text-decoration: none;
186
+ }
187
+
188
+ h2,
189
+ h3,
190
+ h4 {
191
+ font-size: 34px;
192
+ line-height: 1.15;
193
+ letter-spacing: -.015em;
194
+ margin: 53px 0 0;
195
+ }
196
+
197
+ h4 {
198
+ font-size: 26px;
199
+ }
200
+ }
201
+ </style>
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <div class="app-container">
3
+ <aside style="margin-top:15px;">
4
+ Here we use window.print() to implement the feature of downloading PDF.
5
+ </aside>
6
+ <router-link target="_blank" to="/pdf/download">
7
+ <el-button type="primary">
8
+ Click to download PDF
9
+ </el-button>
10
+ </router-link>
11
+ </div>
12
+ </template>
13
+
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <div>
3
+ <div style="margin-bottom:15px;">
4
+ Your roles: {{ roles }}
5
+ </div>
6
+ Switch roles:
7
+ <el-radio-group v-model="switchRoles">
8
+ <el-radio-button label="editor" />
9
+ <el-radio-button label="admin" />
10
+ </el-radio-group>
11
+ </div>
12
+ </template>
13
+
14
+ <script>
15
+ export default {
16
+ computed: {
17
+ roles() {
18
+ return this.$store.getters.roles
19
+ },
20
+ switchRoles: {
21
+ get() {
22
+ return this.roles[0]
23
+ },
24
+ set(val) {
25
+ this.$store.dispatch('user/changeRoles', val).then(() => {
26
+ this.$emit('change')
27
+ })
28
+ }
29
+ }
30
+ }
31
+ }
32
+ </script>