bkzl.vue
920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<template>
<view style="padding:20rpx;">
<view class="content" style="width:100%;overflow:hidden;">
<rich-text class="rich-val" v-html="model.info"></rich-text>
</view>
</view>
</template>
<script>
import BASE_URL from '../../common/config.js'
export default {
data() {
return {
BASE_URL,
model: undefined
}
},
onLoad() {
this.ShowExam()
},
methods: {
ShowExam() {
let data = {
currentPage: 1,
pageSize: 1,
sidx: '',
sort: 'desc'
}
this.API.GetExaminfo(data).then(res => {
console.log('这是备考资料', res)
this.model = res.data.list[0]
var regx=new RegExp('img','g')
this.model.info=this.model.info.replace(regx,'img style="width:100%;height:auto"')
console.log('这是复制', this.model)
})
}
}
}
</script>
<style>
.rich-val {
word-break: break-all;
white-space: pre-line;
}
</style>