Commit 297476ad authored by 吴冠's avatar 吴冠

更新

parent fc1f9e24
...@@ -48,7 +48,8 @@ ...@@ -48,7 +48,8 @@
</div> </div>
<div <div
v-html="detailList.content" v-html="detailList.content"
style="width: 600px; margin: 0 auto" class="content-img"
:style="imgStyle"
></div> ></div>
<div class="flex-center" style="margin-buttom: 40px"> <div class="flex-center" style="margin-buttom: 40px">
<el-button <el-button
...@@ -107,6 +108,10 @@ export default { ...@@ -107,6 +108,10 @@ export default {
Cookies.remove("detailsType"); Cookies.remove("detailsType");
Cookies.remove("detailsId"); 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")){ /* if(Cookies.get("contentTrue")){
let mes = {} let mes = {}
mes.size = Cookies.get("size") mes.size = Cookies.get("size")
...@@ -116,36 +121,9 @@ export default { ...@@ -116,36 +121,9 @@ export default {
} }
Cookies.remove("contentTrue") */ 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() { data() {
return { return {
imgStyle:"{'width':'700px'}",
detailList: {}, detailList: {},
detailsId: "", detailsId: "",
contentList: "", contentList: "",
...@@ -211,6 +189,11 @@ export default { ...@@ -211,6 +189,11 @@ export default {
//点击之后存储id 获取详情 //点击之后存储id 获取详情
async isClick(id) { async isClick(id) {
const { data } = await getnewsdetails(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.detailList = data;
this.isList = false; this.isList = false;
Cookies.set("contentStatus", 1); Cookies.set("contentStatus", 1);
...@@ -245,6 +228,9 @@ export default { ...@@ -245,6 +228,9 @@ export default {
</script> </script>
<style scoped> <style scoped>
.content-img img{
width:700px !important;
}
.pagination { .pagination {
flex:0 ; flex:0 ;
position: absolute; position: absolute;
...@@ -255,7 +241,7 @@ export default { ...@@ -255,7 +241,7 @@ export default {
.message { .message {
border: 1px solid rgba(219, 219, 219, 1); border: 1px solid rgba(219, 219, 219, 1);
min-height: 6.8rem; min-height: 6.8rem;
width: 9.2rem; width:9.2rem;
/* margin-bottom: 200px; */ /* margin-bottom: 200px; */
} }
...@@ -300,7 +286,11 @@ export default { ...@@ -300,7 +286,11 @@ export default {
} }
.content { .content {
width: 9.2rem; width: 9.2rem;
/* width: 100%; */
} }
/* .content img{
width:9.2rem
} */
h1 { h1 {
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -316,6 +306,25 @@ h1 { ...@@ -316,6 +306,25 @@ h1 {
.el-menu-item.is-active{ .el-menu-item.is-active{
color: #ff5203; 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> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment