Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
web-site
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张冬
web-site
Commits
297476ad
Commit
297476ad
authored
Nov 09, 2020
by
吴冠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
fc1f9e24
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
30 deletions
+39
-30
news.vue
pages/index/message/news.vue
+39
-30
No files found.
pages/index/message/news.vue
View file @
297476ad
...
...
@@ -48,7 +48,8 @@
</div>
<div
v-html=
"detailList.content"
style=
"width: 600px; margin: 0 auto"
class=
"content-img"
:style=
"imgStyle"
></div>
<div
class=
"flex-center"
style=
"margin-buttom: 40px"
>
<el-button
...
...
@@ -107,6 +108,10 @@ export default {
Cookies
.
remove
(
"detailsType"
);
Cookies
.
remove
(
"detailsId"
);
}
/* let content = this.detailList.content
console.log(content+'------------')
const regex = new RegExp('<img', 'gi')
this.detailList.content = content.replace(regex, `<img style="max-width: 100%; height: auto"`) */
/* if(Cookies.get("contentTrue")){
let mes = {}
mes.size = Cookies.get("size")
...
...
@@ -116,36 +121,9 @@ export default {
}
Cookies.remove("contentTrue") */
},
/* async asyncData({route}){
let message = {}
message.currentPage = 1
message.size = 10
console.log(+'----------')
let linkTo = Cookies.get("linktoUrl")
let type = linkTo.split("?id")[1]
if(type){
activeName = type
message.cateId = type
}else{
message.cateId = activeName
}
const res = await getCategoryList()
const {data,total} = await getListContent(message)
let detailsType = Cookies.get("detailsType")
let detailsId = Cookies.get("detailsId")
if(detailsType =="1"){
isClick(detailsId)
Cookies.remove("detailsType")
Cookies.remove("detailsId")
}
return {
messageList : data,
total : total,
artList:res
}
}, */
data
()
{
return
{
imgStyle
:
"{'width':'700px'}"
,
detailList
:
{},
detailsId
:
""
,
contentList
:
""
,
...
...
@@ -211,6 +189,11 @@ export default {
//点击之后存储id 获取详情
async
isClick
(
id
)
{
const
{
data
}
=
await
getnewsdetails
(
id
);
for
(
var
i
in
data
){
let
content
=
data
.
content
const
regex
=
new
RegExp
(
'<img'
,
'gi'
)
data
.
content
=
content
.
replace
(
regex
,
`<img style="max-width: 700px; height: auto"`
)
}
this
.
detailList
=
data
;
this
.
isList
=
false
;
Cookies
.
set
(
"contentStatus"
,
1
);
...
...
@@ -245,6 +228,9 @@ export default {
</
script
>
<
style
scoped
>
.content-img
img
{
width
:
700px
!important
;
}
.pagination
{
flex
:
0
;
position
:
absolute
;
...
...
@@ -255,7 +241,7 @@ export default {
.message
{
border
:
1px
solid
rgba
(
219
,
219
,
219
,
1
);
min-height
:
6.8rem
;
width
:
9.2rem
;
width
:
9.2rem
;
/* margin-bottom: 200px; */
}
...
...
@@ -300,7 +286,11 @@ export default {
}
.content
{
width
:
9.2rem
;
/* width: 100%; */
}
/* .content img{
width:9.2rem
} */
h1
{
display
:
flex
;
justify-content
:
center
;
...
...
@@ -316,6 +306,25 @@ h1 {
.el-menu-item.is-active
{
color
:
#ff5203
;
}
/* .content-img{
::v-deep {
img {
width: 100%;
}
}
} */
/* p >>> img {
display: inline-block;
max-width: 100% !important;
height: auto !important;
} */
img
{
max-width
:
100%
!important
;
height
:
auto
!important
;
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment