Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcbfffe5

Browse files
committed
新增博客页面
1 parente722fcb commitcbfffe5

File tree

5 files changed

+40
-19
lines changed

5 files changed

+40
-19
lines changed

‎src/App.vue‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66

77
<script>
88
exportdefault {
9-
name:'App'
9+
name:'App',
10+
created () {
11+
console.log('打印出来的路由',this.$router.options.routes)
12+
}
1013
}
1114
</script>
1215

‎src/router/index.js‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ export default new Router({
1515
name:'HelloWorld',
1616
component:HelloWorld
1717
},
18-
{
19-
path:'/a',
20-
name:'addArticle',
21-
component:addArticle
22-
},
2318
{
2419
path:'/index',
2520
name:'index',
@@ -37,7 +32,7 @@ export default new Router({
3732
component:articleDetail
3833
},
3934
{
40-
path:'/addArticle',
35+
path:'addArticle',
4136
name:'addArticle',
4237
component:addArticle
4338
}

‎src/services/utils/axios.js‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ error => {
7474

7575
exportdefault{
7676
setAxiosGetPromise:(url,params={})=>{
77-
returnaxios.get(url,{params:params}).then(response=>{
77+
returnaxios.get(timestamp(url),{params:params}).then(response=>{
7878
returnresponse
7979
}).catch(err=>{
8080
throwerr
@@ -103,3 +103,16 @@ export default {
103103
})
104104
}
105105
}
106+
107+
// 判断是否IE浏览器,并生成时间戳
108+
functiontimestamp(url){
109+
if(!!window.ActiveXObject||'ActiveXObject'inwindow){
110+
vargetTimestamp=newDate().getTime()
111+
if(url.indexOf('?')>-1){
112+
url=url+'×tamp='+getTimestamp
113+
}else{
114+
url=url+'?timestamp='+getTimestamp
115+
}
116+
}
117+
returnurl
118+
}

‎src/views/index.vue‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div>
2+
<divstyle="display:flex">
33
<myNav></myNav>
44
<divclass="content">
55
<router-view />
@@ -18,11 +18,10 @@ export default {
1818

1919
<style scoped>
2020
.content {
21-
margin-top:61px!important;
22-
min-width:1200px!important;
23-
width:85%!important;
24-
margin:auto!important;
25-
display:block!important;
26-
margin-top:61px!important;
21+
display:flex;
22+
margin-top:61px ;
23+
min-width:1200px ;
24+
width:85% ;
25+
margin:61pxauto0 ;
2726
}
2827
</style>

‎src/views/newArticle.vue‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,38 @@
11
<template>
2-
<div>
2+
<divclass="editor-wrap">
33
<mavon-editorref=md
4-
class="editor":toolbars="toolbars"
4+
class="editor"
5+
:toolbars="toolbars"
56
@imgAdd="$imgAdd"
67
@imgDel="$imgDel"></mavon-editor>
78
</div>
89
</template>
910

1011
<script>
11-
import {toolbars}from'../config/axiosConfig'
12+
import {toolbars}from'../config/axiosConfig'
1213
exportdefault {
1314
data () {
1415
return {
1516
toolbars: toolbars
1617
}
18+
},
19+
created () {
20+
1721
}
1822
}
1923
</script>
2024

2125
<style scoped>
22-
.editor {
26+
.editor-wrap {
27+
margin:auto;
2328
width:100%;
29+
height:100%;
30+
}
31+
.editor {
32+
z-index:100!important;
2433
min-height:700px;
34+
height:700px;
35+
margin-top:20px;
2536
margin-bottom:20px;
2637
}
2738
</style>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp