国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

wangeditor編輯器配置

這篇具有很好參考價值的文章主要介紹了wangeditor編輯器配置。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

wangeditor編輯器配置,編輯器,前端,wangEditor,vue

vue項目中使用編輯器,輕量,操作欄選取自己需要的

官網(wǎng)地址:用于 Vue React | wangEditor

使用在vue項目中引入
?

npm install @wangeditor/editor --save


npm install @wangeditor/editor-for-vue --save

封裝成組件使用

<template>
    <div style="border: 1px solid #ccc; margin:0 auto;">
        <Toolbar
            style="border-bottom: 1px solid #ccc;"
            :editor="editor"
            :defaultConfig="toolbarConfig"
            :mode="mode"
        />
        <Editor
            style="height: 500px; overflow-y: hidden;"
            v-model="html"
            :defaultConfig="editorConfig"
            :mode="mode"
            @onCreated="onCreated"
            @onChange="onChange"
        />
    </div>
</template>
<script>
  import Vue from 'vue'
  import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
  export default Vue.extend({
    components: { Editor, Toolbar },
    props: {
        value: { type: String, required: true },
    },
    data() {
        return {
            editor: null,
            html: '',
            toolbarConfig: { 
                excludeKeys:[
                "blockquote","header1","header2","header3",
                "headerSelect", "fontFamily","code","clearStyle","todo", "emotion","insertLink","insertImage", "insertTable","group-video","codeBlock","redo","headerSelect","insertVideo",
                ]
            },
            editorConfig: { placeholder: '請輸入內(nèi)容...' ,
            MENU_CONF: {
            uploadImage: {// 配置上傳圖片
              customUpload: this.update
            },},},
            mode: 'simple', // or 'default'
        }
    },
    created(){    },
    methods: {
        onCreated(editor) { 
            this.editor = Object.seal(editor) 
        },
        onChange(editor) {
            this.$emit('change', editor.getHtml());
        },
        getEditorText() {
            const editor = this.editor;
            if (editor == null) return;
            
        },        
        update(files,insertFn){//圖片上傳
            var formData = new FormData();
            formData.append('file', files);
            //根據(jù)后臺提供的圖片上傳接口,進行接口配置和上傳
            this.apiSever.post(this.URl.UPLOAD,formData, res => {
                insertFn(res.data.url);
            })
        },
    },
    mounted() {
        this.$nextTick(() => {
            this.html = this.value
        })
    },
    beforeDestroy() {
        const editor = this.editor
        if (editor == null) return
        editor.destroy() 
    }
})
</script>
<style src="@wangeditor/editor/dist/css/style.css"></style>

?文章來源地址http://www.zghlxwxcb.cn/news/detail-605340.html

到了這里,關(guān)于wangeditor編輯器配置的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • vue3項目使用富文本編輯器-wangeditor

    vue3項目使用富文本編輯器-wangeditor

    1.下載依賴 2.插件版本 ?3.使用 引入css和組件 配置方法 模板(標(biāo)簽)中插入 效果 ?

    2024年02月09日
    瀏覽(33)
  • vue2+wangEditor5富文本編輯器

    vue2+wangEditor5富文本編輯器

    1、安裝使用 安裝 yarn add @wangeditor/editor # 或者 npm install @wangeditor/editor --save yarn add @wangeditor/editor-for-vue # 或者 npm install @wangeditor/editor-for-vue --save ?在main.js中引入樣式 import \\\'@wangeditor/editor/dist/css/style.css\\\' ? 在使用編輯器的頁面引入js? import { Editor, Toolbar } from \\\"@wangeditor/editor-fo

    2024年01月22日
    瀏覽(21)
  • vue使用富文本編輯器 Wangeditor 可顯示編輯新增回顯禁用

    vue使用富文本編輯器 Wangeditor 可顯示編輯新增回顯禁用

    npm install wangeditor import editorBar from \\\"@/components/ editor/ editor.vue\\\"; Vue.component(\\\'editorBar\\\', editorBar)? editor-bar v-model=\\\"form.nr\\\" :flag=\\\"false\\\" @change=\\\"getcontent\\\" / mothods:{ ? ? ?//獲取富文本內(nèi)容 ? ? getcontent (content) { ? ? ? ?this.form.nr = content; ? ? }, } editor-bar v-model=\\\"form.nr\\\" :flag=\\\"false\\\" @change=\\\"getc

    2024年02月13日
    瀏覽(38)
  • vue2+wangEditor5富文本編輯器(圖片視頻上傳)并加錨鏈接

    vue2+wangEditor5富文本編輯器(圖片視頻上傳)并加錨鏈接

    官網(wǎng):https://www.wangeditor.com/v5/installation.html#npm 1、安裝使用 安裝 在main.js中引入樣式 在使用編輯器的頁面引入js 模板 js 到這一步編輯完就可以正常顯示了 2、上傳圖片、視頻 1)上傳到后臺接口的可直接按照文檔這個配置就行接口返回格式也要可文檔上一致 2)自定義上傳(一

    2024年02月12日
    瀏覽(93)
  • Vue3 代碼塊高亮顯示并可使用富文本編輯器編輯(highlight.js + wangEditor)

    Vue3 代碼塊高亮顯示并可使用富文本編輯器編輯(highlight.js + wangEditor)

    在Vue項目中實現(xiàn)以下功能: ??功能1. 在頁面中顯示代碼,并將其中的高亮顯示。 ??功能2. 允許對代碼塊進行編輯,編輯時代碼也高亮顯示。 ??功能3. 可在編輯器中添加多個代碼塊,動態(tài)渲染代碼高亮。 ? Step1: 安裝所需插件(本文使用npm安裝,若需

    2023年04月21日
    瀏覽(66)
  • vue2+wangEditor5富文本編輯器(圖片視頻自定義上傳七牛云/服務(wù)器)

    vue2+wangEditor5富文本編輯器(圖片視頻自定義上傳七牛云/服務(wù)器)

    1、安裝使用 安裝 在main.js中引入樣式 在使用編輯器的頁面引入js 模板 js ?到這一步編輯器就可以正常顯示了 2、上傳圖片、視頻 上傳到后臺接口的可直接按照文檔這個配置就行接口返回格式也要可文檔上一致 ? ?2)自定義上傳(一般上傳到別的服務(wù)器上,我這邊是上傳到七

    2024年02月11日
    瀏覽(105)
  • wangEditor富文本編輯器圖片/視頻上傳

    wangEditor富文本編輯器圖片/視頻上傳

    wangEditor 有豐富的 API 和足夠的擴展性,允許我們自定義開發(fā)菜單、模塊、插件等。在 Vue、React 中運用也很方便。因此本文介紹下vue中富文本上傳圖片和視頻。 安裝引入后富文本有顯示上傳圖片按鈕,點擊上傳后會報 沒有配置上傳地址 的錯誤,如下圖所示: 所以自定義上傳

    2024年02月15日
    瀏覽(95)
  • React----富文本編輯器wangEditor的使用

    wangEditor 5 —— 輕量級 web 富文本編輯器,配置方便,使用簡單。支持 IE10+ 瀏覽器。 官網(wǎng):www.wangEditor.com 注意: wangeditor都是小寫字母 Editor : 編輯器組件 Toolbar: 菜單欄組件 實例化編輯器 工具欄配置決定了在工具欄顯示哪些工具,菜單配置決定了該工具使用時的相關(guān)配置。

    2024年01月21日
    瀏覽(30)
  • HTML——實現(xiàn)富文本編輯器wangEditor的使用

    HTML——實現(xiàn)富文本編輯器wangEditor的使用

    背景:最近在寫小說項目,關(guān)于發(fā)布文章需要用到富文本編輯器,由于還沒學(xué)到Vue,最實用的還是用wangEditor富文本編輯器。 官方文檔:http://www.wangeditor.com/ 使用手冊:創(chuàng)建一個編輯器 · wangEditor3使用手冊 · 看云 (kancloud.cn) 至于實現(xiàn)的方式有三種: 一.導(dǎo)入wangEditor.JS 使用方法

    2024年02月11日
    瀏覽(38)
  • wangEditor富文本編輯器的調(diào)用開發(fā)實錄2(V5版本自定義粘貼,去除復(fù)制word或網(wǎng)頁html冗余樣式代碼的解決方案)

    wangEditor富文本編輯器的調(diào)用開發(fā)實錄2(V5版本自定義粘貼,去除復(fù)制word或網(wǎng)頁html冗余樣式代碼的解決方案)

    在使用wangEditor富文本編輯器時,當(dāng)從word文檔或者其他網(wǎng)頁復(fù)制文本內(nèi)容粘貼到編輯器中,如果不過濾掉復(fù)制文本中自帶的樣式,會導(dǎo)致復(fù)制的內(nèi)容比較錯亂,甚至無法添加到數(shù)據(jù)庫中。為了解決這個問題,我們需要對從word中粘貼的內(nèi)容進行處理,把多余的代碼剔除,讓粘貼

    2024年02月16日
    瀏覽(28)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包