1
This commit is contained in:
42
pages/yRead/edit.vue
Normal file
42
pages/yRead/edit.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<template>
|
||||
<view>
|
||||
<editor id="editor" class="ql-container" :placeholder="placeholder" @ready="onEditorReady" @blur='result'></editor>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
placeholder: '开始输入...'
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
onEditorReady() {
|
||||
// #ifdef MP-BAIDU
|
||||
this.editorCtx = requireDynamicLib('editorLib').createEditorContext('editorId');
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS || H5 ||MP-WEIXIN
|
||||
uni.createSelectorQuery().select('#editor').context((res) => {
|
||||
this.editorCtx = res.context
|
||||
}).exec()
|
||||
// #endif
|
||||
},
|
||||
undo() {
|
||||
this.editorCtx.undo()
|
||||
},
|
||||
result(html, text, delta){
|
||||
console.log(html.detail.html)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user