docs: improve code comments (#1911)

This commit is contained in:
花裤衩 2019-04-16 11:20:13 +08:00 committed by GitHub
parent 26d0f40df2
commit be7ec4c0ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
49 changed files with 134 additions and 138 deletions

View File

@ -3,7 +3,7 @@ import Mock from 'mockjs'
const List = [] const List = []
const count = 100 const count = 100
const baseContent = '<p>我是测试数据我是测试数据</p><p><img src="https://wpimg.wallstcn.com/4c69009c-0fd4-4153-b112-6cb53d1cf943"></p>' const baseContent = '<p>I am testing data, I am testing data.</p><p><img src="https://wpimg.wallstcn.com/4c69009c-0fd4-4153-b112-6cb53d1cf943"></p>'
const image_uri = 'https://wpimg.wallstcn.com/e4558086-631c-425c-9430-56ffb46e70b3' const image_uri = 'https://wpimg.wallstcn.com/e4558086-631c-425c-9430-56ffb46e70b3'
for (let i = 0; i < count; i++) { for (let i = 0; i < count; i++) {

View File

@ -1,12 +1,7 @@
<template> <template>
<transition :name="transitionName"> <transition :name="transitionName">
<div v-show="visible" :style="customStyle" class="back-to-ceiling" @click="backToTop"> <div v-show="visible" :style="customStyle" class="back-to-ceiling" @click="backToTop">
<svg width="16" height="16" viewBox="0 0 17 17" xmlns="http://www.w3.org/2000/svg" class="Icon Icon--backToTopArrow" aria-hidden="true" style="height: 16px; width: 16px;"> <svg width="16" height="16" viewBox="0 0 17 17" xmlns="http://www.w3.org/2000/svg" class="Icon Icon--backToTopArrow" aria-hidden="true" style="height:16px;width:16px"><path d="M12.036 15.59a1 1 0 0 1-.997.995H5.032a.996.996 0 0 1-.997-.996V8.584H1.03c-1.1 0-1.36-.633-.578-1.416L7.33.29a1.003 1.003 0 0 1 1.412 0l6.878 6.88c.782.78.523 1.415-.58 1.415h-3.004v7.004z" /></svg>
<title>回到顶部</title>
<g>
<path d="M12.036 15.59c0 .55-.453.995-.997.995H5.032c-.55 0-.997-.445-.997-.996V8.584H1.03c-1.1 0-1.36-.633-.578-1.416L7.33.29c.39-.39 1.026-.385 1.412 0l6.878 6.88c.782.78.523 1.415-.58 1.415h-3.004v7.004z" fill-rule="evenodd" />
</g>
</svg>
</div> </div>
</transition> </transition>
</template> </template>

View File

@ -25,8 +25,8 @@ export default {
}, },
watch: { watch: {
value(value) { value(value) {
const editor_value = this.jsonEditor.getValue() const editorValue = this.jsonEditor.getValue()
if (value !== editor_value) { if (value !== editorValue) {
this.jsonEditor.setValue(JSON.stringify(this.value, null, 2)) this.jsonEditor.setValue(JSON.stringify(this.value, null, 2))
} }
} }

View File

@ -15,6 +15,7 @@
</draggable> </draggable>
</div> </div>
</template> </template>
<script> <script>
import draggable from 'vuedraggable' import draggable from 'vuedraggable'

View File

@ -8,7 +8,6 @@
</template> </template>
<script> <script>
const version = require('element-ui/package.json').version // element-ui version from node_modules const version = require('element-ui/package.json').version // element-ui version from node_modules
const ORIGINAL_THEME = '#409EFF' // default color const ORIGINAL_THEME = '#409EFF' // default color

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="upload-container"> <div class="upload-container">
<el-button :style="{background:color,borderColor:color}" icon="el-icon-upload" size="mini" type="primary" @click=" dialogVisible=true"> <el-button :style="{background:color,borderColor:color}" icon="el-icon-upload" size="mini" type="primary" @click=" dialogVisible=true">
上传图片 upload
</el-button> </el-button>
<el-dialog :visible.sync="dialogVisible"> <el-dialog :visible.sync="dialogVisible">
<el-upload <el-upload
@ -16,14 +16,14 @@
list-type="picture-card" list-type="picture-card"
> >
<el-button size="small" type="primary"> <el-button size="small" type="primary">
点击上传 Click upload
</el-button> </el-button>
</el-upload> </el-upload>
<el-button @click="dialogVisible = false"> <el-button @click="dialogVisible = false">
Cancel
</el-button> </el-button>
<el-button type="primary" @click="handleSubmit"> <el-button type="primary" @click="handleSubmit">
Confirm
</el-button> </el-button>
</el-dialog> </el-dialog>
</div> </div>
@ -54,7 +54,7 @@ export default {
handleSubmit() { handleSubmit() {
const arr = Object.keys(this.listObj).map(v => this.listObj[v]) const arr = Object.keys(this.listObj).map(v => this.listObj[v])
if (!this.checkAllSuccess()) { if (!this.checkAllSuccess()) {
this.$message('请等待所有图片上传成功 或 出现了网络问题,请刷新页面重新上传!') this.$message('Please wait for all images to be uploaded successfully. If there is a network problem, please refresh the page and upload again!')
return return
} }
this.$emit('successCBK', arr) this.$emit('successCBK', arr)

View File

@ -26,7 +26,6 @@
</template> </template>
<script> <script>
//
import { getToken } from '@/api/qiniu' import { getToken } from '@/api/qiniu'
export default { export default {

View File

@ -1,4 +1,3 @@
import { addResizeListener, removeResizeListener } from 'element-ui/src/utils/resize-event' import { addResizeListener, removeResizeListener } from 'element-ui/src/utils/resize-event'
/** /**

View File

@ -1,4 +1,3 @@
import adaptive from './adaptive' import adaptive from './adaptive'
const install = function(Vue) { const install = function(Vue) {

View File

@ -1,4 +1,3 @@
import store from '@/store' import store from '@/store'
export default { export default {

View File

@ -1,4 +1,4 @@
// set function parseTime,formatTime to filter // import parseTime, formatTime and set to filter
export { parseTime, formatTime } from '@/utils' export { parseTime, formatTime } from '@/utils'
/** /**

View File

@ -132,6 +132,9 @@ export default {
cancel: 'Cancel', cancel: 'Cancel',
confirm: 'Confirm' confirm: 'Confirm'
}, },
example: {
warning: 'Creating and editing pages cannot be cached by keep-alive because keep-alive include does not currently support caching based on routes, so it is currently cached based on component name. If you want to achieve a similar caching effect, you can use a browser caching scheme such as localStorage. Or do not use keep-alive include to cache all pages directly. See details'
},
errorLog: { errorLog: {
tips: 'Please click the bug icon in the upper right corner', tips: 'Please click the bug icon in the upper right corner',
description: 'Now the management system are basically the form of the spa, it enhances the user experience, but it also increases the possibility of page problems, a small negligence may lead to the entire page deadlock. Fortunately Vue provides a way to catch handling exceptions, where you can handle errors or report exceptions.', description: 'Now the management system are basically the form of the spa, it enhances the user experience, but it also increases the possibility of page problems, a small negligence may lead to the entire page deadlock. Fortunately Vue provides a way to catch handling exceptions, where you can handle errors or report exceptions.',

View File

@ -132,6 +132,9 @@ export default {
cancel: 'Cancelar', cancel: 'Cancelar',
confirm: 'Confirmar' confirm: 'Confirmar'
}, },
example: {
warning: 'Creating and editing pages cannot be cached by keep-alive because keep-alive include does not currently support caching based on routes, so it is currently cached based on component name. If you want to achieve a similar caching effect, you can use a browser caching scheme such as localStorage. Or do not use keep-alive include to cache all pages directly. See details'
},
errorLog: { errorLog: {
tips: 'Please click the bug icon in the upper right corner', tips: 'Please click the bug icon in the upper right corner',
description: 'Now the management system are basically the form of the spa, it enhances the user experience, but it also increases the possibility of page problems, a small negligence may lead to the entire page deadlock. Fortunately Vue provides a way to catch handling exceptions, where you can handle errors or report exceptions.', description: 'Now the management system are basically the form of the spa, it enhances the user experience, but it also increases the possibility of page problems, a small negligence may lead to the entire page deadlock. Fortunately Vue provides a way to catch handling exceptions, where you can handle errors or report exceptions.',

View File

@ -132,6 +132,9 @@ export default {
cancel: '取 消', cancel: '取 消',
confirm: '确 定' confirm: '确 定'
}, },
example: {
warning: '创建和编辑页面是不能被 keep-alive 缓存的因为keep-alive 的 include 目前不支持根据路由来缓存,所以目前都是基于 component name 来进行缓存的。如果你想类似的实现缓存效果,可以使用 localStorage 等浏览器缓存方案。或者不要使用 keep-alive 的 include直接缓存所有页面。详情见'
},
errorLog: { errorLog: {
tips: '请点击右上角bug小图标', tips: '请点击右上角bug小图标',
description: '现在的管理后台基本都是spa的形式了它增强了用户体验但同时也会增加页面出问题的可能性可能一个小小的疏忽就导致整个页面的死锁。好在 Vue 官网提供了一个方法来捕获处理异常,你可以在其中进行错误处理或者异常上报。', description: '现在的管理后台基本都是spa的形式了它增强了用户体验但同时也会增加页面出问题的可能性可能一个小小的疏忽就导致整个页面的死锁。好在 Vue 官网提供了一个方法来捕获处理异常,你可以在其中进行错误处理或者异常上报。',

View File

@ -2,7 +2,7 @@ import Vue from 'vue'
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
import 'normalize.css/normalize.css' // A modern alternative to CSS resets import 'normalize.css/normalize.css' // a modern alternative to CSS resets
import Element from 'element-ui' import Element from 'element-ui'
import './styles/element-variables.scss' import './styles/element-variables.scss'
@ -13,24 +13,28 @@ import App from './App'
import store from './store' import store from './store'
import router from './router' import router from './router'
import i18n from './lang' // Internationalization import i18n from './lang' // internationalization
import './icons' // icon import './icons' // icon
import './permission' // permission control import './permission' // permission control
import './utils/error-log' // error log import './utils/error-log' // error log
import * as filters from './filters' // global filters import * as filters from './filters' // global filters
import { mockXHR } from '../mock' // simulation data /**
* If you don't want to use mock-server
// mock api in github pages site build * you want to use mockjs for request interception
if (process.env.NODE_ENV === 'production') { mockXHR() } * you can execute:
*
* import { mockXHR } from '../mock'
* mockXHR()
*/
Vue.use(Element, { Vue.use(Element, {
size: Cookies.get('size') || 'medium', // set element-ui default size size: Cookies.get('size') || 'medium', // set element-ui default size
i18n: (key, value) => i18n.t(key, value) i18n: (key, value) => i18n.t(key, value)
}) })
// register global utility filters. // register global utility filters
Object.keys(filters).forEach(key => { Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key]) Vue.filter(key, filters[key])
}) })

View File

@ -1,7 +1,7 @@
import { asyncRoutes, constantRoutes } from '@/router' import { asyncRoutes, constantRoutes } from '@/router'
/** /**
* 通过meta.role判断是否与当前用户权限匹配 * Use meta.role to determine if the current user has permission
* @param roles * @param roles
* @param route * @param route
*/ */
@ -14,7 +14,7 @@ function hasPermission(roles, route) {
} }
/** /**
* 递归过滤异步路由表返回符合用户角色权限的路由表 * Filter asynchronous routing tables by recursion
* @param routes asyncRoutes * @param routes asyncRoutes
* @param roles * @param roles
*/ */

View File

@ -1,4 +1,4 @@
//覆盖一些element-ui样式 // cover some element-ui styles
.el-breadcrumb__inner, .el-breadcrumb__inner,
.el-breadcrumb__inner a { .el-breadcrumb__inner a {

View File

@ -96,14 +96,18 @@ div:focus {
} }
} }
code { aside {
background: #eef1f6; background: #eef1f6;
padding: 15px 16px; padding: 8px 24px;
margin-bottom: 20px; margin-bottom: 20px;
border-radius: 2px;
display: block; display: block;
line-height: 36px; line-height: 32px;
font-size: 15px; font-size: 16px;
font-family: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
color: #2c3e50;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
a { a {
color: #337ab7; color: #337ab7;
@ -115,20 +119,6 @@ code {
} }
} }
.warn-content {
background: rgba(66, 185, 131, .1);
border-radius: 2px;
padding: 16px;
padding: 1rem;
line-height: 1.6rem;
word-spacing: .05rem;
a {
color: #42b983;
font-weight: 600;
}
}
//main-container全局样式 //main-container全局样式
.app-container { .app-container {
padding: 20px; padding: 20px;

View File

@ -1,6 +1,5 @@
#app { #app {
// 主体区域 Main container
.main-container { .main-container {
min-height: 100%; min-height: 100%;
transition: margin-left .28s; transition: margin-left .28s;
@ -8,7 +7,6 @@
position: relative; position: relative;
} }
// 侧边栏 Sidebar container
.sidebar-container { .sidebar-container {
transition: width 0.28s; transition: width 0.28s;
width: $sideBarWidth !important; width: $sideBarWidth !important;
@ -149,7 +147,7 @@
min-width: $sideBarWidth !important; min-width: $sideBarWidth !important;
} }
// 适配移动端, Mobile responsive // mobile responsive
.mobile { .mobile {
.main-container { .main-container {
margin-left: 0px; margin-left: 0px;

View File

@ -7,7 +7,7 @@ import settings from '@/settings'
// errorLog:'production' | ['production', 'development'] // errorLog:'production' | ['production', 'development']
const { errorLog: needErrorLog } = settings const { errorLog: needErrorLog } = settings
function checkNeed(arg) { function checkNeed() {
const env = process.env.NODE_ENV const env = process.env.NODE_ENV
if (isString(needErrorLog)) { if (isString(needErrorLog)) {
return env === needErrorLog return env === needErrorLog

View File

@ -5,23 +5,25 @@ import { getToken } from '@/utils/auth'
// create an axios instance // create an axios instance
const service = axios.create({ const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API, // api 的 base_url baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
withCredentials: true, // 跨域请求时发送 cookies withCredentials: true, // send cookies when cross-domain requests
timeout: 5000 // request timeout timeout: 5000 // request timeout
}) })
// request interceptor // request interceptor
service.interceptors.request.use( service.interceptors.request.use(
config => { config => {
// Do something before request is sent // do something before request is sent
if (store.getters.token) { if (store.getters.token) {
// 让每个请求携带token-- ['X-Token']为自定义key 请根据实际情况自行修改 // let each request carry token --['X-Token'] as a custom key.
// please modify it according to the actual situation.
config.headers['X-Token'] = getToken() config.headers['X-Token'] = getToken()
} }
return config return config
}, },
error => { error => {
// Do something with request error // do something with request error
console.log(error) // for debug console.log(error) // for debug
return Promise.reject(error) return Promise.reject(error)
} }
@ -33,31 +35,33 @@ service.interceptors.response.use(
* If you want to get information such as headers or status * If you want to get information such as headers or status
* Please return response => response * Please return response => response
*/ */
/** /**
* 下面的注释为通过在response里自定义code来标示请求状态 * Determine the request status by custom code
* 当code返回如下情况则说明权限有问题登出并返回到登录页 * Here is just an example
* 如想通过 XMLHttpRequest 来状态码标识 逻辑可写在下面error中 * You can also judge the status by HTTP Status Code.
* 以下代码均为样例请结合自生需求加以修改若不需要则可删除
*/ */
response => { response => {
const res = response.data const res = response.data
// if the custom code is not 20000, it is judged as an error.
if (res.code !== 20000) { if (res.code !== 20000) {
Message({ Message({
message: res.message || 'error', message: res.message || 'error',
type: 'error', type: 'error',
duration: 5 * 1000 duration: 5 * 1000
}) })
// 50008:非法的token; 50012:其他客户端登录了; 50014:Token 过期了;
// 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
if (res.code === 50008 || res.code === 50012 || res.code === 50014) { if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
// 请自行在引入 MessageBox // to re-login
// import { Message, MessageBox } from 'element-ui' MessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', {
MessageBox.confirm('你已被登出,可以取消继续留在该页面,或者重新登录', '确定登出', { confirmButtonText: 'Re-Login',
confirmButtonText: '重新登录', cancelButtonText: 'Cancel',
cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
store.dispatch('user/resetToken').then(() => { store.dispatch('user/resetToken').then(() => {
location.reload() // 为了重新实例化vue-router对象 避免bug location.reload()
}) })
}) })
} }

View File

@ -1,9 +1,9 @@
<template> <template>
<div class="components-container"> <div class="components-container">
<code>This is based on <aside>This is based on
<a class="link-type" href="//github.com/dai-siki/vue-image-crop-upload"> vue-image-crop-upload</a>. <a class="link-type" href="//github.com/dai-siki/vue-image-crop-upload"> vue-image-crop-upload</a>.
{{ $t('components.imageUploadTips') }} {{ $t('components.imageUploadTips') }}
</code> </aside>
<pan-thumb :image="image" /> <pan-thumb :image="image" />

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="components-container"> <div class="components-container">
<code>{{ $t('components.backToTopTips1') }}</code> <aside>{{ $t('components.backToTopTips1') }}</aside>
<code>{{ $t('components.backToTopTips2') }}</code> <aside>{{ $t('components.backToTopTips2') }}</aside>
<div class="placeholder-container"> <div class="placeholder-container">
<div>placeholder</div> <div>placeholder</div>
<div>placeholder</div> <div>placeholder</div>
@ -113,8 +113,7 @@
<div>placeholder</div> <div>placeholder</div>
<div>placeholder</div> <div>placeholder</div>
</div> </div>
<!--可自定义按钮的样式show/hide临界点返回的位置 --> <!-- you can add element-ui's tooltip -->
<!--如需文字提示可在外部添加element的<el-tooltip></el-tooltip> -->
<el-tooltip placement="top" content="tooltip"> <el-tooltip placement="top" content="tooltip">
<back-to-top :custom-style="myBackToTopStyle" :visibility-height="300" :back-position="50" transition-name="fade" /> <back-to-top :custom-style="myBackToTopStyle" :visibility-height="300" :back-position="50" transition-name="fade" />
</el-tooltip> </el-tooltip>
@ -129,6 +128,7 @@ export default {
components: { BackToTop }, components: { BackToTop },
data() { data() {
return { return {
// customizable button style, show/hide critical point, return position
myBackToTopStyle: { myBackToTopStyle: {
right: '50px', right: '50px',
bottom: '50px', bottom: '50px',

View File

@ -1,8 +1,8 @@
<template> <template>
<div class="components-container"> <div class="components-container">
<p class="warn-content"> <aside>
<a href="https://github.com/PanJiaChen/vue-countTo" target="_blank">countTo-component</a> <a href="https://github.com/PanJiaChen/vue-countTo" target="_blank">countTo-component</a>
</p> </aside>
<count-to <count-to
ref="example" ref="example"
:start-val="_startVal" :start-val="_startVal"
@ -45,9 +45,9 @@
<input v-model="setSuffix" name="suffixInput"> <input v-model="setSuffix" name="suffixInput">
</label> </label>
</div> </div>
<code>&lt;count-to :start-val=&#x27;{{ _startVal }}&#x27; :end-val=&#x27;{{ _endVal }}&#x27; :duration=&#x27;{{ _duration }}&#x27; <aside>&lt;count-to :start-val=&#x27;{{ _startVal }}&#x27; :end-val=&#x27;{{ _endVal }}&#x27; :duration=&#x27;{{ _duration }}&#x27;
:decimals=&#x27;{{ _decimals }}&#x27; :separator=&#x27;{{ _separator }}&#x27; :prefix=&#x27;{{ _prefix }}&#x27; :suffix=&#x27;{{ _suffix }}&#x27; :decimals=&#x27;{{ _decimals }}&#x27; :separator=&#x27;{{ _separator }}&#x27; :prefix=&#x27;{{ _prefix }}&#x27; :suffix=&#x27;{{ _suffix }}&#x27;
:autoplay=false&gt;</code> :autoplay=false&gt;</aside>
</div> </div>
</template> </template>

View File

@ -1,8 +1,8 @@
<template> <template>
<div class="components-container"> <div class="components-container">
<code>drag-list base on <aside>drag-list base on
<a href="https://github.com/SortableJS/Vue.Draggable" target="_blank">Vue.Draggable</a> <a href="https://github.com/SortableJS/Vue.Draggable" target="_blank">Vue.Draggable</a>
</code> </aside>
<div class="editor-container"> <div class="editor-container">
<dnd-list :list1="list1" :list2="list2" list1-title="List" list2-title="Article pool" /> <dnd-list :list1="list1" :list2="list2" list1-title="List" list2-title="Article pool" />
</div> </div>

View File

@ -1,9 +1,9 @@
<template> <template>
<div class="components-container"> <div class="components-container">
<code> <aside>
Based on <a class="link-type" href="https://github.com/rowanwins/vue-dropzone"> dropzone </a>. Based on <a class="link-type" href="https://github.com/rowanwins/vue-dropzone"> dropzone </a>.
{{ $t('components.dropzoneTips') }} {{ $t('components.dropzoneTips') }}
</code> </aside>
<div class="editor-container"> <div class="editor-container">
<dropzone id="myVueDropzone" url="https://httpbin.org/post" @dropzone-removedFile="dropzoneR" @dropzone-success="dropzoneS" /> <dropzone id="myVueDropzone" url="https://httpbin.org/post" @dropzone-removedFile="dropzoneR" @dropzone-success="dropzoneS" />
</div> </div>

View File

@ -1,10 +1,10 @@
<template> <template>
<div class="components-container"> <div class="components-container">
<code>Json-Editor is base on <a href="https://github.com/codemirror/CodeMirror" target="_blank">CodeMirrorr</a>. Lint <aside>Json-Editor is base on <a href="https://github.com/codemirror/CodeMirror" target="_blank">CodeMirrorr</a>. Lint
base on <a base on <a
href="https://github.com/codemirror/CodeMirror/blob/master/addon/lint/json-lint.js" href="https://github.com/codemirror/CodeMirror/blob/master/addon/lint/json-lint.js"
target="_blank" target="_blank"
>json-lint</a>.</code> >json-lint</a>.</aside>
<div class="editor-container"> <div class="editor-container">
<json-editor ref="jsonEditor" v-model="value" /> <json-editor ref="jsonEditor" v-model="value" />
</div> </div>

View File

@ -1,13 +1,13 @@
<template> <template>
<div class="components-container"> <div class="components-container">
<code>Markdown is based on <aside>Markdown is based on
<a href="https://github.com/nhnent/tui.editor" target="_blank">tui.editor</a> simply wrapped with Vue. <a href="https://github.com/nhnent/tui.editor" target="_blank">tui.editor</a> simply wrapped with Vue.
<a <a
target="_blank" target="_blank"
href="https://panjiachen.github.io/vue-element-admin-site/feature/component/markdown-editor.html" href="https://panjiachen.github.io/vue-element-admin-site/feature/component/markdown-editor.html"
> >
Documentation </a> Documentation </a>
</code> </aside>
<div class="editor-container"> <div class="editor-container">
<el-tag class="tag-title"> <el-tag class="tag-title">

View File

@ -1,10 +1,10 @@
<template> <template>
<div class="components-container"> <div class="components-container">
<code><strong>SplitPane</strong> If you've used <aside><strong>SplitPane</strong> If you've used
<a href="https://codepen.io/" target="_blank"> codepen</a>, <a href="https://codepen.io/" target="_blank"> codepen</a>,
<a href="https://jsfiddle.net/" target="_blank"> jsfiddle </a>will not be unfamiliar. <a href="https://jsfiddle.net/" target="_blank"> jsfiddle </a>will not be unfamiliar.
<a href="https://github.com/PanJiaChen/vue-split-pane" target="_blank"> Github repository</a> <a href="https://github.com/PanJiaChen/vue-split-pane" target="_blank"> Github repository</a>
</code> </aside>
<split-pane split="vertical" @resize="resize"> <split-pane split="vertical" @resize="resize">
<template slot="paneL"> <template slot="paneL">
<div class="left-container" /> <div class="left-container" />

View File

@ -37,7 +37,7 @@
</sticky> </sticky>
<div class="components-container"> <div class="components-container">
<code>Sticky header, {{ $t('components.stickyTips') }}</code> <aside>Sticky header, {{ $t('components.stickyTips') }}</aside>
<div>placeholder</div> <div>placeholder</div>
<div>placeholder</div> <div>placeholder</div>
<div>placeholder</div> <div>placeholder</div>

View File

@ -1,9 +1,9 @@
<template> <template>
<div class="components-container"> <div class="components-container">
<code> <aside>
{{ $t('components.tinymceTips') }} {{ $t('components.tinymceTips') }}
<a target="_blank" class="link-type" href="https://panjiachen.github.io/vue-element-admin-site/component/rich-editor.html"> {{ $t('components.documentation') }}</a> <a target="_blank" class="link-type" href="https://panjiachen.github.io/vue-element-admin-site/component/rich-editor.html"> {{ $t('components.documentation') }}</a>
</code> </aside>
<div> <div>
<tinymce v-model="content" :height="300" /> <tinymce v-model="content" :height="300" />
</div> </div>

View File

@ -4,12 +4,12 @@
<ErrorB /> <ErrorB />
<!-- $t is vue-i18n global function to translate lang --> <!-- $t is vue-i18n global function to translate lang -->
<h3>{{ $t('errorLog.tips') }}</h3> <h3>{{ $t('errorLog.tips') }}</h3>
<code> <aside>
{{ $t('errorLog.description') }} {{ $t('errorLog.description') }}
<a target="_blank" class="link-type" href="https://panjiachen.github.io/vue-element-admin-site/guide/advanced/error.html"> <a target="_blank" class="link-type" href="https://panjiachen.github.io/vue-element-admin-site/guide/advanced/error.html">
{{ $t('errorLog.documentation') }} {{ $t('errorLog.documentation') }}
</a> </a>
</code> </aside>
<a href="#"> <a href="#">
<img src="https://wpimg.wallstcn.com/360e4842-4db5-42d0-b078-f9a84a825546.gif"> <img src="https://wpimg.wallstcn.com/360e4842-4db5-42d0-b078-f9a84a825546.gif">
</a> </a>

View File

@ -6,10 +6,10 @@
<PlatformDropdown v-model="postForm.platforms" /> <PlatformDropdown v-model="postForm.platforms" />
<SourceUrlDropdown v-model="postForm.source_uri" /> <SourceUrlDropdown v-model="postForm.source_uri" />
<el-button v-loading="loading" style="margin-left: 10px;" type="success" @click="submitForm"> <el-button v-loading="loading" style="margin-left: 10px;" type="success" @click="submitForm">
发布 Publush
</el-button> </el-button>
<el-button v-loading="loading" type="warning" @click="draftForm"> <el-button v-loading="loading" type="warning" @click="draftForm">
草稿 Draft
</el-button> </el-button>
</sticky> </sticky>
@ -20,28 +20,28 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item style="margin-bottom: 40px;" prop="title"> <el-form-item style="margin-bottom: 40px;" prop="title">
<MDinput v-model="postForm.title" :maxlength="100" name="name" required> <MDinput v-model="postForm.title" :maxlength="100" name="name" required>
标题 Title
</MDinput> </MDinput>
</el-form-item> </el-form-item>
<div class="postInfo-container"> <div class="postInfo-container">
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label-width="45px" label="作者:" class="postInfo-container-item"> <el-form-item label-width="60px" label="Author:" class="postInfo-container-item">
<el-select v-model="postForm.author" :remote-method="getRemoteUserList" filterable default-first-option remote placeholder="搜索用户"> <el-select v-model="postForm.author" :remote-method="getRemoteUserList" filterable default-first-option remote placeholder="Search user">
<el-option v-for="(item,index) in userListOptions" :key="item+index" :label="item" :value="item" /> <el-option v-for="(item,index) in userListOptions" :key="item+index" :label="item" :value="item" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<el-form-item label-width="80px" label="发布时间:" class="postInfo-container-item"> <el-form-item label-width="120px" label="Publush Time:" class="postInfo-container-item">
<el-date-picker v-model="postForm.display_time" type="datetime" format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期时间" /> <el-date-picker v-model="postForm.display_time" type="datetime" format="yyyy-MM-dd HH:mm:ss" placeholder="Select date and time" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label-width="60px" label="重要性:" class="postInfo-container-item"> <el-form-item label-width="90px" label="Importance:" class="postInfo-container-item">
<el-rate <el-rate
v-model="postForm.importance" v-model="postForm.importance"
:max="3" :max="3"
@ -57,8 +57,8 @@
</el-col> </el-col>
</el-row> </el-row>
<el-form-item style="margin-bottom: 40px;" label-width="45px" label="摘要:"> <el-form-item style="margin-bottom: 40px;" label-width="70px" label="Summary:">
<el-input v-model="postForm.content_short" :rows="1" type="textarea" class="article-textarea" autosize placeholder="请输入内容" /> <el-input v-model="postForm.content_short" :rows="1" type="textarea" class="article-textarea" autosize placeholder="Please enter the content" />
<span v-show="contentShortLength" class="word-counter">{{ contentShortLength }}</span> <span v-show="contentShortLength" class="word-counter">{{ contentShortLength }}</span>
</el-form-item> </el-form-item>

View File

@ -1,17 +1,17 @@
<template> <template>
<el-dropdown :show-timeout="100" trigger="click"> <el-dropdown :show-timeout="100" trigger="click">
<el-button plain> <el-button plain>
{{ !comment_disabled?'评论已打开':'评论已关闭' }} {{ !comment_disabled?'Comment: opened':'Comment: closed' }}
<i class="el-icon-caret-bottom el-icon--right" /> <i class="el-icon-caret-bottom el-icon--right" />
</el-button> </el-button>
<el-dropdown-menu slot="dropdown" class="no-padding"> <el-dropdown-menu slot="dropdown" class="no-padding">
<el-dropdown-item> <el-dropdown-item>
<el-radio-group v-model="comment_disabled" style="padding: 10px;"> <el-radio-group v-model="comment_disabled" style="padding: 10px;">
<el-radio :label="true"> <el-radio :label="true">
关闭评论 Close comment
</el-radio> </el-radio>
<el-radio :label="false"> <el-radio :label="false">
打开评论 Open comment
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</el-dropdown-item> </el-dropdown-item>

View File

@ -1,7 +1,7 @@
<template> <template>
<el-dropdown :hide-on-click="false" :show-timeout="100" trigger="click"> <el-dropdown :hide-on-click="false" :show-timeout="100" trigger="click">
<el-button plain> <el-button plain>
平台({{ platforms.length }}) Platfroms({{ platforms.length }})
<i class="el-icon-caret-bottom el-icon--right" /> <i class="el-icon-caret-bottom el-icon--right" />
</el-button> </el-button>
<el-dropdown-menu slot="dropdown" class="no-border"> <el-dropdown-menu slot="dropdown" class="no-border">

View File

@ -1,14 +1,14 @@
<template> <template>
<el-dropdown :show-timeout="100" trigger="click"> <el-dropdown :show-timeout="100" trigger="click">
<el-button plain> <el-button plain>
外链 Link
<i class="el-icon-caret-bottom el-icon--right" /> <i class="el-icon-caret-bottom el-icon--right" />
</el-button> </el-button>
<el-dropdown-menu slot="dropdown" class="no-padding no-border" style="width:400px"> <el-dropdown-menu slot="dropdown" class="no-padding no-border" style="width:400px">
<el-form-item label-width="0px" style="margin-bottom: 0px" prop="source_uri"> <el-form-item label-width="0px" style="margin-bottom: 0px" prop="source_uri">
<el-input v-model="source_uri" placeholder="请输入内容"> <el-input v-model="source_uri" placeholder="Please enter the content">
<template slot="prepend"> <template slot="prepend">
填写url URL
</template> </template>
</el-input> </el-input>
</el-form-item> </el-form-item>

View File

@ -1,11 +1,10 @@
<template> <template>
<p class="warn-content"> <aside>
创建和编辑页面是不能被keep-alive 缓存的因为keep-alive 的include 目前不支持根据路由来缓存所以目前都是基于component name 来缓存的如果你想要实现缓存的效果可以使用localstorage 等浏览器缓存方案或者不要使用keep-alive {{ $t('example.warning') }}
的include直接缓存所有页面详情见
<a <a
href="https://panjiachen.github.io/vue-element-admin-site/guide/essentials/tags-view.html" href="https://panjiachen.github.io/vue-element-admin-site/guide/essentials/tags-view.html"
target="_blank" target="_blank"
>文档</a> >Document</a>
</p> </aside>
</template> </template>

View File

@ -1,9 +1,9 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<p class="warn-content"> <aside>
{{ $t('guide.description') }} {{ $t('guide.description') }}
<a href="https://github.com/kamranahmedse/driver.js" target="_blank">driver.js.</a> <a href="https://github.com/kamranahmedse/driver.js" target="_blank">driver.js.</a>
</p> </aside>
<el-button icon="el-icon-question" type="primary" @click.prevent.stop="guide"> <el-button icon="el-icon-question" type="primary" @click.prevent.stop="guide">
{{ $t('guide.button') }} {{ $t('guide.button') }}
</el-button> </el-button>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<code style="margin-top:15px;">{{ $t('pdf.tips') }}</code> <aside style="margin-top:15px;">{{ $t('pdf.tips') }}</aside>
<router-link target="_blank" to="/pdf/download"> <router-link target="_blank" to="/pdf/download">
<el-button type="primary"> <el-button type="primary">
Click to download PDF Click to download PDF

View File

@ -35,10 +35,10 @@
</div> </div>
<div :key="'checkPermission'+key" style="margin-top:60px;"> <div :key="'checkPermission'+key" style="margin-top:60px;">
<code> <aside>
{{ $t('permission.tips') }} {{ $t('permission.tips') }}
<br> e.g. <br> e.g.
</code> </aside>
<el-tabs type="border-card" style="width:550px;"> <el-tabs type="border-card" style="width:550px;">
<el-tab-pane v-if="checkPermission(['admin'])" label="Admin"> <el-tab-pane v-if="checkPermission(['admin'])" label="Admin">

View File

@ -1,9 +1,9 @@
<template> <template>
<div class="icons-container"> <div class="icons-container">
<p class="warn-content"> <aside>
<a href="https://panjiachen.github.io/vue-element-admin-site/guide/advanced/icon.html" target="_blank">Add and use <a href="https://panjiachen.github.io/vue-element-admin-site/guide/advanced/icon.html" target="_blank">Add and use
</a> </a>
</p> </aside>
<el-tabs type="border-card"> <el-tabs type="border-card">
<el-tab-pane label="Icons"> <el-tab-pane label="Icons">
<div v-for="item of iconsMap" :key="item" @click="handleClipboard(generateIconCode(item),$event)"> <div v-for="item of iconsMap" :key="item" @click="handleClipboard(generateIconCode(item),$event)">

View File

@ -148,9 +148,9 @@
<script> <script>
import { fetchList, fetchPv, createArticle, updateArticle } from '@/api/article' import { fetchList, fetchPv, createArticle, updateArticle } from '@/api/article'
import waves from '@/directive/waves' // Waves directive import waves from '@/directive/waves' // waves directive
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination import Pagination from '@/components/Pagination' // secondary package based on el-pagination
const calendarTypeOptions = [ const calendarTypeOptions = [
{ key: 'CN', display_name: 'China' }, { key: 'CN', display_name: 'China' },

View File

@ -9,7 +9,7 @@
<div class="box-item"> <div class="box-item">
<span class="field-label">{{ $t('theme.change') }} : </span> <span class="field-label">{{ $t('theme.change') }} : </span>
<el-switch v-model="theme" /> <el-switch v-model="theme" />
<code style="margin-top:15px;">{{ $t('theme.tips') }}</code> <aside style="margin-top:15px;">{{ $t('theme.tips') }}</aside>
</div> </div>
</el-card> </el-card>

View File

@ -86,6 +86,7 @@ module.exports = {
.end() .end()
config config
// https://webpack.js.org/configuration/devtool/#development
.when(process.env.NODE_ENV === 'development', .when(process.env.NODE_ENV === 'development',
config => config.devtool('cheap-source-map') config => config.devtool('cheap-source-map')
) )