提交
This commit is contained in:
70
pages/articleList/common-editor.vue
Normal file
70
pages/articleList/common-editor.vue
Normal file
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<view class="richtext" style="height: 100%;">
|
||||
<piaoyiEditor :height="height" :placeholder="placeholder" :values="values" @changes="saveContens" :readOnly="readOnly" :photoUrl="photoUrl" :api="api" :name="name"/>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import piaoyiEditor from '@/uni_modules/piaoyi-editor/components/piaoyi-editor/piaoyi-editor.vue';
|
||||
export default {
|
||||
props: {
|
||||
content: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
readOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
photoUrl: 'https://api.nuttyreading.com', //服务器图片域名或者ip
|
||||
api: '/oss/fileoss', //上传图片接口地址
|
||||
txt: '',
|
||||
name: 'file',
|
||||
values: ''
|
||||
};
|
||||
},
|
||||
components: {
|
||||
piaoyiEditor
|
||||
},
|
||||
methods: {
|
||||
saveContens(e) {
|
||||
this.txt = e.html
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
if (res.from === 'button') { // 来自页面内分享按钮
|
||||
console.log(res.target)
|
||||
}
|
||||
return {
|
||||
title: '多功能富文本编辑器!',
|
||||
path: '/pages/editor/editor'
|
||||
}
|
||||
},
|
||||
onShareTimeline(res) {
|
||||
if (res.from === 'button') { // 来自页面内分享按钮
|
||||
console.log(res.target)
|
||||
}
|
||||
return {
|
||||
title: '多功能富文本编辑器!'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user