大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。
Jetbrains全系列IDE稳定放心使用
1.引用quill
<script src="/lib/quill/quill.min.js"></script>
<link href="/lib/quill/quill.snow.css" rel="stylesheet" />
2.RichEditorDemo.vue
<template>
<div class="yh-page">
<h1>富文本编辑器演示</h1>
<div class="desc">Demo源代码:
<code>/examples/components/modules/RichEditorDemo.vue</code>
</div>
<div class="yh-block">
<el-row>
<el-col :span="13">
<div id="editor" style="height:300px"></div>
<div style="margin-top:15px;text-align:center">
<yh-button @click="onSave">保存</yh-button>
</div>
</el-col>
<el-col :span="11">
<div id="re-content" style="background-color:#fefefe;height:300px;width:100%;padding:8px"></div>
</el-col>
</el-row>
</div>
<div class="yh-desc yh-block">
<h2>引用quill</h2>
<pre><script src="/lib/quill/quill.min.js"></script>
<link href="/lib/quill/quill.snow.css" rel="stylesheet" /></pre>
</div>
</div>
</template>
<script>
import yhbutton from "../comcompont/Button";
export default {
name: "RichEditorDemo",
data() {
return {};
},
methods: {
onSave() {
var delta = this.$quill.getContents();
console.log("delta " + JSON.stringify(delta));
var html = this.$quill.root.innerHTML;
$("#re-content").html(html);
}
},
mounted() {
var quill = new Quill("#editor", {
modules: {
toolbar: [
[{ header: [1, 2, false] }],
["bold", "italic", "underline"],
[{ color: [] }, { background: [] }],
[{ font: [] }],
[{ align: [] }],
["image", "link"]
]
},
theme: "snow"
});
this.$quill = quill;
},
components: {
"yh-button": yhbutton,
}
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scope>
</style>
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/182100.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...