90 lines
1.7 KiB
Vue
90 lines
1.7 KiB
Vue
<template>
|
|
<view class="app">
|
|
<view class="body" v-if="value">
|
|
<rich-text :nodes="value" class="text"></rich-text>
|
|
</view>
|
|
<view class="noorder" v-else>
|
|
<u-empty mode="list" icon-size='220' text='暂无内容'></u-empty>
|
|
</view>
|
|
</view>
|
|
<!-- <springEditor v-model='value'></springEditor> -->
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
getNodeDetail
|
|
} from '@/api/Mymedication/Mymedication.js'
|
|
export default {
|
|
data() {
|
|
return {
|
|
contentsid: '',
|
|
value: '',
|
|
valuesname: '',
|
|
}
|
|
},
|
|
onLoad(options) {
|
|
console.log(options, 'options,')
|
|
if (options) {
|
|
getNodeDetail(options.id).then(res => {
|
|
// this.value = res.data.nodeContent
|
|
this.value = res.data.nodeContent.replace(/\<p/gi,
|
|
"<p class='ptext'")
|
|
this.value = res.data.nodeContent.replace(/\<span/,
|
|
"<span class='ql-size-small'")
|
|
console.log(this.value)
|
|
|
|
})
|
|
|
|
}
|
|
},
|
|
methods: {
|
|
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.ptext {
|
|
width: 100rpx !important;
|
|
height: 80rpx !important;
|
|
}
|
|
|
|
.ql-size-small {
|
|
color: #22343C;
|
|
// background: #E5F5F2;
|
|
// padding: 5px 10px ;
|
|
height: 80rpx !important;
|
|
// background-color: red !important;
|
|
}
|
|
|
|
.text {
|
|
width: 84%;
|
|
overflow: hidden;
|
|
word-break: break-all;
|
|
// margin-top: 20rpx;
|
|
text-overflow: ellipsis;
|
|
margin-left: 30rpx;
|
|
position: relative;
|
|
// left: 16%;
|
|
}
|
|
|
|
.app {
|
|
height: 100vh;
|
|
background-color: #F7F5F5;
|
|
padding: 30rpx 0 0 0;
|
|
overflow: scroll;
|
|
font-size: 28rpx;
|
|
|
|
.body {
|
|
width: 95%;
|
|
height: 100%;
|
|
background: #fff;
|
|
margin: 40rpx auto;
|
|
// padding-top: 15rpx;
|
|
box-shadow: 0px 4px 15px 4px rgba(0, 0, 0, 0.03);
|
|
border-radius: 2px;
|
|
padding: 20rpx 0 0 100rpx;
|
|
|
|
}
|
|
}
|
|
</style> |