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

更新

parent fc1f9e24
......@@ -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>
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