Support stick post.

pull/40/head
ruibaby 2019-08-30 20:58:22 +08:00
parent a8ade50451
commit 5d654db0c9
8 changed files with 31 additions and 14 deletions

View File

@ -19,6 +19,7 @@
"nprogress": "^0.2.0",
"verte": "^0.0.12",
"vue": "^2.6.10",
"vue-clipboard2": "^0.3.0",
"vue-codemirror-lite": "^1.0.4",
"vue-count-to": "^1.0.13",
"vue-ls": "^3.2.1",

View File

@ -1,13 +1,21 @@
<template>
<div id="app">
<router-view />
</div>
<a-locale-provider :locale="locale">
<div id="app">
<router-view />
</div>
</a-locale-provider>
</template>
<script>
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
import { deviceEnquire, DEVICE_TYPE } from '@/utils/device'
export default {
data() {
return {
locale: zhCN
}
},
mounted() {
const { $store } = this
deviceEnquire(deviceType => {
@ -36,3 +44,4 @@ export default {
height: 100%;
}
</style>

View File

@ -7,6 +7,9 @@ import '@/core/lazy_lib/components_use'
import 'ant-design-vue/dist/antd.less'
import bootstrap from './bootstrap'
import VueClipboard from 'vue-clipboard2'
Vue.use(VueStorage, config.storageOptions)
Vue.use(VueClipboard)
bootstrap()

View File

@ -6,6 +6,9 @@ import config from '@/config/defaultSettings'
import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/antd.less'
import VueClipboard from 'vue-clipboard2'
Vue.use(Antd)
Vue.use(VueStorage, config.storageOptions)
Vue.use(VueClipboard)

View File

@ -112,7 +112,7 @@ export default {
handleSaveDraft() {
this.postToStage.status = 'DRAFT'
if (!this.postToStage.title) {
this.postToStage.title = moment(new Date())
this.postToStage.title = moment(new Date()).format('YYYY-MM-DD-HH-mm-ss')
}
if (!this.postToStage.originalContent) {
this.postToStage.originalContent = '开始编辑...'

View File

@ -128,20 +128,12 @@
:loading="postsLoading"
:pagination="false"
>
<!-- ellipsis内嵌a标签后文本会被置空
<ellipsis
:length="25"
tooltip
slot="postTitle"
slot-scope="text,record"
>
{{ text }}
</ellipsis> -->
<span
slot="postTitle"
slot-scope="text,record"
style="max-width: 150px;display: block;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
>
<a-icon type="pushpin" v-if="record.topPriority!=0" theme="twoTone" twoToneColor="red" />
<a
:href="options.blog_url+'/archives/'+record.url"
target="_blank"

View File

@ -50,6 +50,15 @@
<a-radio :value="true">关闭</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="是否置顶:">
<a-radio-group
v-model="selectedPost.topPriority"
:defaultValue="0"
>
<a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio>
</a-radio-group>
</a-form-item>
</a-form>
</div>
</div>

View File

@ -102,7 +102,7 @@ export default {
handleSaveDraft() {
this.sheetToStage.status = 'DRAFT'
if (!this.sheetToStage.title) {
this.sheetToStage.title = moment(new Date())
this.sheetToStage.title = moment(new Date()).format('YYYY-MM-DD-HH-mm-ss')
}
if (!this.sheetToStage.originalContent) {
this.sheetToStage.originalContent = '开始编辑...'