mirror of https://github.com/halo-dev/halo-admin
Support stick post.
parent
a8ade50451
commit
5d654db0c9
|
@ -19,6 +19,7 @@
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
"verte": "^0.0.12",
|
"verte": "^0.0.12",
|
||||||
"vue": "^2.6.10",
|
"vue": "^2.6.10",
|
||||||
|
"vue-clipboard2": "^0.3.0",
|
||||||
"vue-codemirror-lite": "^1.0.4",
|
"vue-codemirror-lite": "^1.0.4",
|
||||||
"vue-count-to": "^1.0.13",
|
"vue-count-to": "^1.0.13",
|
||||||
"vue-ls": "^3.2.1",
|
"vue-ls": "^3.2.1",
|
||||||
|
|
15
src/App.vue
15
src/App.vue
|
@ -1,13 +1,21 @@
|
||||||
<template>
|
<template>
|
||||||
<div id="app">
|
<a-locale-provider :locale="locale">
|
||||||
<router-view />
|
<div id="app">
|
||||||
</div>
|
<router-view />
|
||||||
|
</div>
|
||||||
|
</a-locale-provider>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
|
||||||
import { deviceEnquire, DEVICE_TYPE } from '@/utils/device'
|
import { deviceEnquire, DEVICE_TYPE } from '@/utils/device'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
locale: zhCN
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
const { $store } = this
|
const { $store } = this
|
||||||
deviceEnquire(deviceType => {
|
deviceEnquire(deviceType => {
|
||||||
|
@ -36,3 +44,4 @@ export default {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,9 @@ import '@/core/lazy_lib/components_use'
|
||||||
import 'ant-design-vue/dist/antd.less'
|
import 'ant-design-vue/dist/antd.less'
|
||||||
import bootstrap from './bootstrap'
|
import bootstrap from './bootstrap'
|
||||||
|
|
||||||
|
import VueClipboard from 'vue-clipboard2'
|
||||||
|
|
||||||
Vue.use(VueStorage, config.storageOptions)
|
Vue.use(VueStorage, config.storageOptions)
|
||||||
|
Vue.use(VueClipboard)
|
||||||
|
|
||||||
bootstrap()
|
bootstrap()
|
||||||
|
|
|
@ -6,6 +6,9 @@ import config from '@/config/defaultSettings'
|
||||||
import Antd from 'ant-design-vue'
|
import Antd from 'ant-design-vue'
|
||||||
import 'ant-design-vue/dist/antd.less'
|
import 'ant-design-vue/dist/antd.less'
|
||||||
|
|
||||||
|
import VueClipboard from 'vue-clipboard2'
|
||||||
|
|
||||||
Vue.use(Antd)
|
Vue.use(Antd)
|
||||||
|
|
||||||
Vue.use(VueStorage, config.storageOptions)
|
Vue.use(VueStorage, config.storageOptions)
|
||||||
|
Vue.use(VueClipboard)
|
||||||
|
|
|
@ -112,7 +112,7 @@ export default {
|
||||||
handleSaveDraft() {
|
handleSaveDraft() {
|
||||||
this.postToStage.status = 'DRAFT'
|
this.postToStage.status = 'DRAFT'
|
||||||
if (!this.postToStage.title) {
|
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) {
|
if (!this.postToStage.originalContent) {
|
||||||
this.postToStage.originalContent = '开始编辑...'
|
this.postToStage.originalContent = '开始编辑...'
|
||||||
|
|
|
@ -128,20 +128,12 @@
|
||||||
:loading="postsLoading"
|
:loading="postsLoading"
|
||||||
:pagination="false"
|
:pagination="false"
|
||||||
>
|
>
|
||||||
<!-- ellipsis内嵌a标签后文本会被置空
|
|
||||||
<ellipsis
|
|
||||||
:length="25"
|
|
||||||
tooltip
|
|
||||||
slot="postTitle"
|
|
||||||
slot-scope="text,record"
|
|
||||||
>
|
|
||||||
{{ text }}
|
|
||||||
</ellipsis> -->
|
|
||||||
<span
|
<span
|
||||||
slot="postTitle"
|
slot="postTitle"
|
||||||
slot-scope="text,record"
|
slot-scope="text,record"
|
||||||
style="max-width: 150px;display: block;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
|
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
|
<a
|
||||||
:href="options.blog_url+'/archives/'+record.url"
|
:href="options.blog_url+'/archives/'+record.url"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|
|
@ -50,6 +50,15 @@
|
||||||
<a-radio :value="true">关闭</a-radio>
|
<a-radio :value="true">关闭</a-radio>
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
</a-form-item>
|
</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>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -102,7 +102,7 @@ export default {
|
||||||
handleSaveDraft() {
|
handleSaveDraft() {
|
||||||
this.sheetToStage.status = 'DRAFT'
|
this.sheetToStage.status = 'DRAFT'
|
||||||
if (!this.sheetToStage.title) {
|
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) {
|
if (!this.sheetToStage.originalContent) {
|
||||||
this.sheetToStage.originalContent = '开始编辑...'
|
this.sheetToStage.originalContent = '开始编辑...'
|
||||||
|
|
Loading…
Reference in New Issue