如何制作自定义文本和样式

我是男性网站,用户可以在其中制作网站简介。来自 mywebsite 的用户如何自定义文本和样式,例如加粗、着色等?


慕尼黑8549860
浏览 128回答 1
1回答

蝴蝶不菲

您需要使用好的所见即所得编辑器,例如https://github.com/scrumpy/tiptap你可以像这样进行基本设置<template>&nbsp; <editor-content :editor="editor" /></template><script>// Import the editorimport { Editor, EditorContent } from 'tiptap'export default {&nbsp; components: {&nbsp; &nbsp; EditorContent,&nbsp; },&nbsp; data() {&nbsp; &nbsp; return {&nbsp; &nbsp; &nbsp; editor: null,&nbsp; &nbsp; }&nbsp; },&nbsp; mounted() {&nbsp; &nbsp; this.editor = new Editor({&nbsp; &nbsp; &nbsp; content: '<p>This is just a boring paragraph</p>',&nbsp; &nbsp; })&nbsp; },&nbsp; beforeDestroy() {&nbsp; &nbsp; this.editor.destroy()&nbsp; },}</script>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript