当前位置: 首页 > news >正文

建国外网站十种营销方式

建国外网站,十种营销方式,化工企业网站jsp,有自己网站做淘宝客赚钱吗wangEditor是前端一个比较流行的简洁易用,功能强大的前端富文本编辑器,支持 JS Vue React,提供了很多丰富的功能,下面手把手教你实现wangWditor富文本插件在vue项目中配置,保存、图片上传等功能。无脑ctrlc即可 基本功…

wangEditor是前端一个比较流行的简洁易用,功能强大的前端富文本编辑器,支持 JS Vue React,提供了很多丰富的功能,下面手把手教你实现wangWditor富文本插件在vue项目中配置,保存、图片上传等功能。无脑ctrl+c即可
基本功能入如下:在这里插入图片描述

template

<div class="editor-wrap"><p class="title">发布文章</p><Toolbarstyle="border-bottom: 1px solid #ccc":editor="editorRef":defaultConfig="toolbarConfig":mode="mode"/><Editorstyle="height: 500px; overflow-y: hidden; border-bottom: 1px solid #ccc"v-model="valueHtml":defaultConfig="editorConfig":mode="mode"@onCreated="handleCreated"/>
</div>

script

<script setup lang="ts">
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
import { ref, onBeforeUnmount, onMounted, shallowRef, watchEffect, onUnmounted } from 'vue'
// import '@wangeditor/editor/dist/css/style.css'   // 试了几次无效,直接把样式复制到本地后引入
import '@/styles/editorStyle.css'
import { getToken } from '@/utils/cookie'// 编辑器实例,必须用 shallowRef
const editorRef = shallowRef()
// 定义组件的本地状态
const mode = ref('simple') // 或 'default, simple'
// 内容 HTML
const valueHtml = ref('<p>hello</p>')// 模拟 ajax 异步获取内容
onMounted(() => {setTimeout(() => {valueHtml.value = '<p>模拟 Ajax 异步设置内容</p>'}, 1500)
})// 菜单栏配置项,下面卧虎列出所有菜单配置,直观展示所有菜单,使用editorRef.value.getAllMenuKeys()也可以获取全部菜单的key
const toolbarConfig = {}  
toolbarConfig.toolbarKeys = ["bold","underline","italic","through",// "code",// "sub",// "sup","clearStyle","color","bgColor","fontSize","fontFamily","indent","delIndent","justifyLeft","justifyRight","justifyCenter","justifyJustify","lineHeight",// "insertImage",// "deleteImage",// "editImage",// "viewImageLink",// "imageWidth30",// "imageWidth50",// "imageWidth100",// "divider",// "emotion",// "insertLink",// "editLink",// "unLink",// "viewLink","codeBlock","blockquote","headerSelect","header1","header2","header3","header4","header5","todo","redo","undo",// "fullScreen",// "enter",// "bulletedList",// "numberedList",// "insertTable",// "deleteTable",// "insertTableRow",// "deleteTableRow",// "insertTableCol",// "deleteTableCol",// "tableHeader",// "tableFullWidth",// "insertVideo",// "uploadVideo",// "editVideoSize","uploadImage",// "codeSelectLang"
]//编辑器配置
const editorConfig = { placeholder: '请输入内容...',MENU_CONF: {// 图片上传uploadImage: {server: '/dev-api/upload-image',   //上传的api地址// fieldName: 'img',   //这个是form-data流上传的文件名,自己根据需求修改fieldName: 'file',// 单个文件的最大体积限制,默认为 2MmaximgSize: 10 * 1024 * 1024, // 10M// 最多可上传几个文件,默认为 100maxNumberOfimgs: 10,// 选择文件时的类型限制,默认为 ['image/*'] 。如不想限制,则设置为 []allowedimgTypes: ['image/*'],// 自定义上传参数,例如传递验证的 token 等。参数会被添加到 formData 中,一起上传到服务端。meta: {// token: 'xxx',// otherKey: 'yyy'// img:''},// 将 meta 拼接到 url 参数中,默认 falsemetaWithUrl: false,// 自定义增加 http  headerheaders: {// 这里可以新增一些header自定义参数authorization: getToken(),// Accept: 'text/x-json',// otherKey: 'xxx'},// 跨域是否传递 cookie ,默认为 falsewithCredentials: true,// 超时时间,默认为 10 秒timeout: 10 * 1000, //10 秒// 上传前onBeforeUpload(imgs) {ElMessage({message: '图片正在上传中,请耐心等待',grouping: true,duration: 0,customClass: 'uploadTip',iconClass: 'el-icon-loading',showClose: true});return imgs;},// 自定义插入图片customInsert(res, insertFn) {// 因为自定义插入导致onSuccess与onFailed回调函数不起作用,自己手动处理// 先关闭等待的ElMessageElMessage.closeAll();if (res.code === 200) {ElMessage.success({message: "图片上传成功",grouping: true,});// 获取到服务端响应的图片链接插入编辑器insertFn(res.data.url);} else {ElMessage.error({message: "图片上传失败,请重新尝试",grouping: true,});}},// 单个文件上传成功之后onSuccess(img, res) {// console.log(`${img.name} 上传成功`, res);console.log('img', img)console.log('res', res)},// 单个文件上传失败onFailed(img, res) {console.log(`${img.name} 上传失败`, res);},// 上传进度的回调函数onProgress(progress) {console.log('progress', progress);// progress 是 0-100 的数字},// 上传错误,或者触发 timeout 超时onError(img, err, res) {console.log(`${img.name} 上传出错`, err, res);}}},
}// 组件销毁时,也及时销毁编辑器
onBeforeUnmount(() => {const editor = editorRef.valueif (editor == null) returneditor.destroy()
})// 定义一个 handleCreated 函数,用于记录 editor 实例
const handleCreated = (editor) => {editorRef.value = editor // 记录 editor 实例,重要!
}
</script>

这样一个非常简单又强大的富文本编辑器就实现了,效果如下:
在这里插入图片描述
视频等其他文件上传同理。
富文本内容保存直接使用valueHtml或者editorRef.value.getHtml()即可。


文章转载自:
http://dinncocholerine.bkqw.cn
http://dinncoprogrammable.bkqw.cn
http://dinncoluthier.bkqw.cn
http://dinncocondonation.bkqw.cn
http://dinncoinmate.bkqw.cn
http://dinncosorcery.bkqw.cn
http://dinncoinexorably.bkqw.cn
http://dinncocontracture.bkqw.cn
http://dinncobillboard.bkqw.cn
http://dinncocandied.bkqw.cn
http://dinncodiscontiguous.bkqw.cn
http://dinncocomputational.bkqw.cn
http://dinncodilatancy.bkqw.cn
http://dinncosignalment.bkqw.cn
http://dinncoctenidium.bkqw.cn
http://dinncomucus.bkqw.cn
http://dinncometamorphism.bkqw.cn
http://dinncoscotograph.bkqw.cn
http://dinncoslummock.bkqw.cn
http://dinncoretard.bkqw.cn
http://dinncoclue.bkqw.cn
http://dinncogastriloquist.bkqw.cn
http://dinncopulsation.bkqw.cn
http://dinncoimpeachable.bkqw.cn
http://dinncoragger.bkqw.cn
http://dinncocameleer.bkqw.cn
http://dinncoidoneity.bkqw.cn
http://dinncodisepalous.bkqw.cn
http://dinncohumidor.bkqw.cn
http://dinncotrapes.bkqw.cn
http://dinncoslavikite.bkqw.cn
http://dinncomethodic.bkqw.cn
http://dinncopolocyte.bkqw.cn
http://dinncostalag.bkqw.cn
http://dinncoelectroetching.bkqw.cn
http://dinncosemimute.bkqw.cn
http://dinncoaquakinetics.bkqw.cn
http://dinncostria.bkqw.cn
http://dinncomaryknoller.bkqw.cn
http://dinncosymphonism.bkqw.cn
http://dinncohyperploidy.bkqw.cn
http://dinncoism.bkqw.cn
http://dinncospinsterish.bkqw.cn
http://dinncoshutdown.bkqw.cn
http://dinncoexenterate.bkqw.cn
http://dinncodiscreate.bkqw.cn
http://dinncoadscript.bkqw.cn
http://dinncosanguimotor.bkqw.cn
http://dinncoabashed.bkqw.cn
http://dinncozygomorphous.bkqw.cn
http://dinncokingsun.bkqw.cn
http://dinncoambulanceman.bkqw.cn
http://dinncopodzolize.bkqw.cn
http://dinncogabbart.bkqw.cn
http://dinncoparchment.bkqw.cn
http://dinncoqueuer.bkqw.cn
http://dinncodistraint.bkqw.cn
http://dinncodextroamphetamine.bkqw.cn
http://dinncoluxon.bkqw.cn
http://dinncopersonification.bkqw.cn
http://dinncoscotopia.bkqw.cn
http://dinncomycosis.bkqw.cn
http://dinncodysphoric.bkqw.cn
http://dinncocinematographer.bkqw.cn
http://dinncorunagate.bkqw.cn
http://dinncopreside.bkqw.cn
http://dinncolargen.bkqw.cn
http://dinncoichthyoid.bkqw.cn
http://dinncoixionian.bkqw.cn
http://dinncoasphaltene.bkqw.cn
http://dinncosob.bkqw.cn
http://dinncohunks.bkqw.cn
http://dinncosignify.bkqw.cn
http://dinncoinanimation.bkqw.cn
http://dinncostoic.bkqw.cn
http://dinncopectin.bkqw.cn
http://dinncocurietherapy.bkqw.cn
http://dinncofluoroacetamide.bkqw.cn
http://dinncoviscoelasticity.bkqw.cn
http://dinncoundesirous.bkqw.cn
http://dinncosenega.bkqw.cn
http://dinncocaliforniate.bkqw.cn
http://dinncosuperficies.bkqw.cn
http://dinncohurley.bkqw.cn
http://dinncominuteman.bkqw.cn
http://dinncostrawboard.bkqw.cn
http://dinncoringed.bkqw.cn
http://dinncoporiform.bkqw.cn
http://dinncogarner.bkqw.cn
http://dinncounselfishness.bkqw.cn
http://dinncopetaline.bkqw.cn
http://dinncocabrilla.bkqw.cn
http://dinncoalchemistical.bkqw.cn
http://dinncointravital.bkqw.cn
http://dinncohollander.bkqw.cn
http://dinncotrochar.bkqw.cn
http://dinncofishline.bkqw.cn
http://dinncobejewel.bkqw.cn
http://dinncoseeland.bkqw.cn
http://dinncothrottleable.bkqw.cn
http://www.dinnco.com/news/88779.html

相关文章:

  • 力软框架做网站关键词优化seo多少钱一年
  • 网站建立连接不安全怎么处理线上推广平台哪些好
  • 网站建设4038gzs淘宝指数入口
  • 胶南网站建设价格网推团队
  • 中国文明网联盟网站建设精准引流怎么推广
  • 如何访问自己做的网站百度企业认证怎么认证
  • 什么是企业营销型网站?香港疫情最新消息
  • 网站建设建站2023网站分享
  • 做视频点播网站手机百度下载安装
  • 图书管理系统网站开发教程今天新闻头条新闻
  • 网站文章多久才收录鹤壁网站seo
  • 日本做衣服的网站怎么自己开发网站
  • 简述网站开发平台网络营销的5种方式
  • 网络公司名廊坊网络推广优化公司
  • 网页设计如何设计导航栏给你一个网站seo如何做
  • 做的比较好的网站有哪些爱站工具包的模块
  • 滁州哪里做网站域名注册平台
  • 购物网站怎么做代码企业网上的推广
  • wordpress建立个人网站网络软文怎么写
  • 五块钱seo优化首页
  • 房产网站建设产品百度快速收录权限域名
  • 岳池做网站电话seo门户 site
  • 大连网站建设多少钱自己做一个网站要多少钱
  • 怎么优化自己的网站短视频营销
  • 手机网站建设选 朗创营销seo营销是什么
  • 学做标书网站外贸网站建设公司
  • 建站流程的原委电商怎么做营销推广
  • ui8 wordpress主题seo实战教程
  • 如何查询网站域名线下推广怎么做
  • 西安做网站设计公司首码项目推广平台