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
49 changed files with 134 additions and 138 deletions

View File

@@ -1,9 +1,9 @@
<template>
<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>.
{{ $t('components.imageUploadTips') }}
</code>
</aside>
<pan-thumb :image="image" />

View File

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

View File

@@ -1,8 +1,8 @@
<template>
<div class="components-container">
<p class="warn-content">
<aside>
<a href="https://github.com/PanJiaChen/vue-countTo" target="_blank">countTo-component</a>
</p>
</aside>
<count-to
ref="example"
:start-val="_startVal"
@@ -45,9 +45,9 @@
<input v-model="setSuffix" name="suffixInput">
</label>
</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;
:autoplay=false&gt;</code>
:autoplay=false&gt;</aside>
</div>
</template>

View File

@@ -1,8 +1,8 @@
<template>
<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>
</code>
</aside>
<div class="editor-container">
<dnd-list :list1="list1" :list2="list2" list1-title="List" list2-title="Article pool" />
</div>

View File

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

View File

@@ -1,10 +1,10 @@
<template>
<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
href="https://github.com/codemirror/CodeMirror/blob/master/addon/lint/json-lint.js"
target="_blank"
>json-lint</a>.</code>
>json-lint</a>.</aside>
<div class="editor-container">
<json-editor ref="jsonEditor" v-model="value" />
</div>

View File

@@ -1,13 +1,13 @@
<template>
<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
target="_blank"
href="https://panjiachen.github.io/vue-element-admin-site/feature/component/markdown-editor.html"
>
Documentation </a>
</code>
</aside>
<div class="editor-container">
<el-tag class="tag-title">

View File

@@ -1,10 +1,10 @@
<template>
<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://jsfiddle.net/" target="_blank"> jsfiddle </a>will not be unfamiliar.
<a href="https://github.com/PanJiaChen/vue-split-pane" target="_blank"> Github repository</a>
</code>
</aside>
<split-pane split="vertical" @resize="resize">
<template slot="paneL">
<div class="left-container" />

View File

@@ -37,7 +37,7 @@
</sticky>
<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>

View File

@@ -1,9 +1,9 @@
<template>
<div class="components-container">
<code>
<aside>
{{ $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>
</code>
</aside>
<div>
<tinymce v-model="content" :height="300" />
</div>

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,14 +1,14 @@
<template>
<el-dropdown :show-timeout="100" trigger="click">
<el-button plain>
外链
Link
<i class="el-icon-caret-bottom el-icon--right" />
</el-button>
<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-input v-model="source_uri" placeholder="请输入内容">
<el-input v-model="source_uri" placeholder="Please enter the content">
<template slot="prepend">
填写url
URL
</template>
</el-input>
</el-form-item>

View File

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

View File

@@ -1,9 +1,9 @@
<template>
<div class="app-container">
<p class="warn-content">
<aside>
{{ $t('guide.description') }}
<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">
{{ $t('guide.button') }}
</el-button>

View File

@@ -1,6 +1,6 @@
<template>
<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">
<el-button type="primary">
Click to download PDF

View File

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

View File

@@ -1,9 +1,9 @@
<template>
<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>
</p>
</aside>
<el-tabs type="border-card">
<el-tab-pane label="Icons">
<div v-for="item of iconsMap" :key="item" @click="handleClipboard(generateIconCode(item),$event)">

View File

@@ -148,9 +148,9 @@
<script>
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 Pagination from '@/components/Pagination' // Secondary package based on el-pagination
import Pagination from '@/components/Pagination' // secondary package based on el-pagination
const calendarTypeOptions = [
{ key: 'CN', display_name: 'China' },
@@ -159,7 +159,7 @@ const calendarTypeOptions = [
{ key: 'EU', display_name: 'Eurozone' }
]
// arr to obj ,such as { CN : "China", US : "USA" }
// arr to obj, such as { CN : "China", US : "USA" }
const calendarTypeKeyValue = calendarTypeOptions.reduce((acc, cur) => {
acc[cur.key] = cur.display_name
return acc

View File

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