first commit
This commit is contained in:
parent
2f1a426223
commit
fbafa3db60
@ -144,7 +144,6 @@
|
||||
let _ts = this;
|
||||
let activeMenu = _ts.$store.state.activeMenu;
|
||||
if (activeMenu !== item) {
|
||||
this.$store.commit('setActiveMenu', item);
|
||||
if (item === 'topic') {
|
||||
_ts.$router.push(
|
||||
{
|
||||
|
@ -52,14 +52,13 @@ export default {
|
||||
** https://nuxtjs.org/guide/plugins
|
||||
*/
|
||||
plugins: [
|
||||
'@/plugins/element-ui',
|
||||
// '@/plugins/axios'
|
||||
{src: '@/plugins/element-ui', ssr: true},
|
||||
{src: '@/plugins/vditor', ssr: false}
|
||||
],
|
||||
/*
|
||||
** Nuxt.js dev-modules
|
||||
*/
|
||||
buildModules: [
|
||||
],
|
||||
buildModules: [],
|
||||
/*
|
||||
** Nuxt.js modules
|
||||
*/
|
||||
|
@ -120,7 +120,7 @@
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import { mapState } from 'vuex';
|
||||
import VditorPreview from 'vditor/dist/method.min';
|
||||
|
||||
export default {
|
||||
name: "ArticleDetail",
|
||||
validate({params, store}) {
|
||||
@ -141,6 +141,11 @@
|
||||
isMobile: state => state.global.isMobile,
|
||||
})
|
||||
},
|
||||
head () {
|
||||
return {
|
||||
title: this.article.articleTitle
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isShow: true,
|
||||
@ -191,17 +196,17 @@
|
||||
const previewElement = document.getElementById("articleContent");
|
||||
// //const outLineElement = document.getElementById("articleToC");
|
||||
// VditorPreview.setContentTheme('light');
|
||||
VditorPreview.codeRender(previewElement, 'zh_CN');
|
||||
VditorPreview.highlightRender({"enable":true,"lineNumber":false,"style":"github"}, previewElement);
|
||||
VditorPreview.mathRender(previewElement, {
|
||||
Vue.VditorPreview.codeRender(previewElement, 'zh_CN');
|
||||
Vue.VditorPreview.highlightRender({"enable":true,"lineNumber":false,"style":"github"}, previewElement);
|
||||
Vue.VditorPreview.mathRender(previewElement, {
|
||||
math: {"engine":"KaTeX","inlineDigit":false,"macros":{}},
|
||||
});
|
||||
VditorPreview.mermaidRender(previewElement, ".language-mermaid");
|
||||
VditorPreview.graphvizRender(previewElement);
|
||||
VditorPreview.chartRender(previewElement);
|
||||
VditorPreview.mindmapRender(previewElement);
|
||||
VditorPreview.abcRender(previewElement);
|
||||
VditorPreview.mediaRender(previewElement);
|
||||
Vue.VditorPreview.mermaidRender(previewElement, ".language-mermaid");
|
||||
Vue.VditorPreview.graphvizRender(previewElement);
|
||||
Vue.VditorPreview.chartRender(previewElement);
|
||||
Vue.VditorPreview.mindmapRender(previewElement);
|
||||
Vue.VditorPreview.abcRender(previewElement);
|
||||
Vue.VditorPreview.mediaRender(previewElement);
|
||||
//VditorPreview.outlineRender(previewElement, outLineElement);
|
||||
})
|
||||
}
|
||||
|
@ -78,6 +78,7 @@
|
||||
}
|
||||
|
||||
_ts.$axios.$post('/api/v1/console/login', data).then(function (res) {
|
||||
console.log(res);
|
||||
if (res.data) {
|
||||
if (res.data.message) {
|
||||
_ts.$message(res.data.message);
|
||||
|
4
plugins/vditor.js
Normal file
4
plugins/vditor.js
Normal file
@ -0,0 +1,4 @@
|
||||
import Vue from 'vue';
|
||||
import VditorPreview from 'vditor/dist/method.min';
|
||||
|
||||
Vue.VditorPreview = VditorPreview
|
@ -81,24 +81,24 @@ export const actions = {
|
||||
// const delay = fetchDelay(
|
||||
// isBrowser
|
||||
// )
|
||||
console.log(params)
|
||||
if (isBrowser) {
|
||||
Vue.nextTick(() => {
|
||||
window.scrollTo(0, 300);
|
||||
})
|
||||
}
|
||||
// if (isBrowser) {
|
||||
// Vue.nextTick(() => {
|
||||
// window.scrollTo(0, 300);
|
||||
// })
|
||||
// }
|
||||
commit('updateDetailFetching', true)
|
||||
commit('updateDetailData', {})
|
||||
// commit('updateDetailData', {})
|
||||
return this.$axios
|
||||
.$get(`${ARTICLE_API_PATH}/article/${params.article_id}`)
|
||||
.then(response => {
|
||||
return new Promise(resolve => {
|
||||
commit('updateDetailData', response.data)
|
||||
commit('updateDetailFetching', false)
|
||||
// return new Promise(resolve => {
|
||||
resolve(response)
|
||||
// delay(() => {
|
||||
// resolve(response)
|
||||
// })
|
||||
// })
|
||||
})
|
||||
})
|
||||
.catch(error => {
|
||||
commit('updateDetailFetching', false)
|
||||
|
Loading…
Reference in New Issue
Block a user