content‘ is declared but its value is never read.富文本编辑器中这里必须的script中添加setup,引入到set当中时,带title的富文本写法

简介: content‘ is declared but its value is never read.富文本编辑器中这里必须的script中添加setup,引入到set当中时,带title的富文本写法

想要的样式:

let content = ref("<p> 初始内容。。。</p>");报红的原因

今天在敲文本时,content报错了

这里该如何解决:

第一个解决的方法,富文本编辑器中这里必须的script中添加setup

第二个 export中再使用的时候,必须要添加第二个script

第三个 看绑定数据,下一步

看绑定数据的资料:

这里注意要添加content

添加v-model,这里要注意content添加的内容

代码:

<template>
    <div class="editorContainer">
        <el-form ref="ruleFormRef" style="max-width: 900px" :model="ruleForm" :rules="rules" label-width="auto"
            class="demo-ruleForm" :size="formSize" status-icon>
            <el-form-item label="标题" prop="name">
                <el-input v-model="ruleForm.name" />
            </el-form-item>
            <div class="editorContent">
                <div class="leftcontentContainer">内容</div>
                <div class="editor">
                    <quill-editor content-type='html' v-model:content='articleModel.content' :options='options'
                        @blur='editorBlur($event)' />
                    <!-- <quill-editor content-type='html' :content='content' :options='options'
                        @blur='editorBlur($event)' /> -->
                    <!-- <quill-editor content-type='html' :content='content' :options='options'
                        @blur='editorBlur($event)' /> -->
                </div>
            </div>
            <div class="mb-4">
                <el-button round>保存</el-button>
                <el-button type="primary" round>提交</el-button>
            </div>
        </el-form>
    </div>
</template>
 
<script setup>
// import { ref } from 'vue';
// let content = ref("<p> 初始内容。。。</p>");
let options = {
    modules: {
        toolbar: [
            ['bold', 'italic', 'underline', 'strike'], // 加粗 斜体 下划线 删除线
            [{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
            [{ align: [] }], // 对齐方式
            [{ size: ['small', false, 'large', 'huge'] }], // 字体大小
            [{ font: [] }], // 字体种类
            [{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
            [{ direction: 'ltl' }], // 文本方向
            [{ direction: 'rtl' }], // 文本方向
            [{ indent: '-1' }, { indent: '+1' }], // 缩进
            [{ list: 'ordered' }, { list: 'bullet' }], // 有序、无序列表
            [{ script: 'sub' }, { script: 'super' }], // 上标/下标
            ['blockquote', 'code-block'], // 引用  代码块
            ['clean'], // 清除文本格式
            ['link', 'image', 'video'], // 链接、图片、视频
        ],
    },
};
 
</script>
<script>
export default {
    data() {
        return {
            ruleForm: [{
                name: ''
            }],
            articleModel: [{
                content: ''
            }]
        }
    }
}
</script>
<style lang="less">
.demo-ruleForm {
    margin: 0 auto;
}
 
.div span {
    text-align: left;
}
 
.editorContent {
    display: flex;
}
 
.editorContainer {
    margin-top: 15px;
}
 
.leftcontentContainer {
    margin-right: 9px;
}
 
.editor {
    width: 857px;
    margin-bottom: 60px;
}
 
.ql-container {
    height: 400px;
}
 
.demo-ruleForm {
    width: 1000px;
}
 
.mb-4 button {
    margin: 0 0 0 760px;
}
</style>
相关文章
|
4月前
|
JSON Java 关系型数据库
Java更新数据库报错:Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.
在Java中,使用mybatis-plus更新实体类对象到mysql,其中一个字段对应数据库中json数据类型,更新时报错:Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.
447 4
Java更新数据库报错:Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.
成功解决A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,co
成功解决A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,co
|
7月前
|
Java 应用服务中间件 nginx
【Azure 环境】Azure应用程序网关设置set_Cookie=key=value; SameSite=Strict; HTTPOnly,AzureAD登录使用cookie时使用不了的案例记录
【Azure 环境】Azure应用程序网关设置set_Cookie=key=value; SameSite=Strict; HTTPOnly,AzureAD登录使用cookie时使用不了的案例记录
|
8月前
|
数据处理 Python
【Python】已解决:SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFram
【Python】已解决:SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFram
1093 1
|
JavaScript API
【Vue】Cannot set reactive property on undefined,null,or primitive value:undefined
【Vue】Cannot set reactive property on undefined,null,or primitive value:undefined
445 0
|
9月前
|
缓存 NoSQL 关系型数据库
Redis第二课,1.set key value(设置对应的key和value)2.get key(得到value值)Redis全局命令(支持很多的数据结构)3.keys(用来查询当前
Redis第二课,1.set key value(设置对应的key和value)2.get key(得到value值)Redis全局命令(支持很多的数据结构)3.keys(用来查询当前
|
10月前
What value should kernel parameter AIO-MAX-NR be set to ?
What value should kernel parameter AIO-MAX-NR be set to ?
80 0
|
10月前
|
开发工具
百度搜索:蓝易云【使用vim编辑器,进行保存时报错:E382: Cannot write, ‘buftype‘ option is set详解。】
请注意,'buftype'选项的设置通常是由于某些插件或配置文件导致的。如果您在Vim的配置文件(如.vimrc)或使用的插件中设置了'buftype'选项,请检查相关配置并确保设置正确。
125 0
成功解决pandas\core\indexing.py:179: SettingWithCopyWarning: A value is trying to be set on a copy of a
成功解决pandas\core\indexing.py:179: SettingWithCopyWarning: A value is trying to be set on a copy of a
|
消息中间件 Kafka
Cannot set the value of read-only property ‘additionalSourceDirs‘ for task ‘:jacocoRootReport‘ of
这个问题是gradle的build版本问题,我是在build kafka的老版本时报的错,这个问题我查了一遍网上的内容,发现很多博客忽略了IDEA settings关于gradle的build的一个配置。
572 0
Cannot set the value of read-only property ‘additionalSourceDirs‘ for task ‘:jacocoRootReport‘ of