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

vs网站制作教程职业培训机构排名前十

vs网站制作教程,职业培训机构排名前十,联系人网站设计,武汉高端网站建设首先我使用的富文本编辑器是vue-quill-editor 使用npm进行下载 npm install vue-quill-editor --save当然也可以按照官方的方法下载,到官方 因为我是在原有老项目上开发的使用的组件库是ant-design-vue 1x版,当然使用其他组件库也可以 然后还有重要的一…

首先我使用的富文本编辑器是vue-quill-editor
使用npm进行下载

npm install vue-quill-editor --save

当然也可以按照官方的方法下载,到官方
因为我是在原有老项目上开发的使用的组件库是ant-design-vue 1x版,当然使用其他组件库也可以
然后还有重要的一步需要引入jquery后面有地方需要用到
使用npm进行下载jquery

npm install jquery --save;

下面直接上代码

<template><div><quill-editor ref="myQuillEditor" v-model="content" :options="editorOption" /><a-upload list-type="picture-card" class="quill-upload" :show-upload-list="false" :multiple="true" v-show="false":data="headerdata" action="https://upload-cn-east-2.qiniup.com" :before-upload="beforeUploadlogin"@change="handleChangeloginbig" :on-success="quillSuccess"><i class="el-icon-upload"></i></a-upload></div>
</template><script>const toolbarOptions = [['bold', 'italic', 'underline', 'strike'], // toggled buttons['blockquote', 'code-block'],[{header: 1}, {header: 2}], // custom button values[{list: 'ordered'}, {list: 'bullet'}],[{script: 'sub'}, {script: 'super'}], // superscript/subscript[{indent: '-1'}, {indent: '+1'}], // outdent/indent[{direction: 'rtl'}], // text direction[{size: ['small', false, 'large', 'huge']}], // custom dropdown[{header: [1, 2, 3, 4, 5, 6, false]}],[{color: []}, {background: []}], // dropdown with defaults from theme[{font: []}],[{align: []}],['link', 'image', 'video'],['clean'] // remove formatting button];import API from "@/Api/index.js";import UNITY from "@/commont/user.js";export default {data() {return {content: "",headerdata: {token: "",key: "",},loginimageUrlbig: [],URL: "",cyloginimageUrlbig: [],editorOption: {modules: {toolbar: {container: toolbarOptions,handlers: {// 重写点击组件上的图片按钮要执行的代码这里用到了jquery'image': (value) => {document.querySelector('.quill-upload .el-icon-upload').click()}}}}},cyput: 0}},created() {},methods: {async beforeUploadlogin(file) {this.cyput++let that = this;let time = new Date().getTime();time = time + '' + that.cyput//这边是封装的接口await API.UPLOADUPLOADTOKEN().then(res => {that.headerdata.token = res.data.data.token;that.headerdata.key = "permanent/head/" + time + '.png';that.URL = UNITY.getSession("qiniu_cdnurl");})const sizeOk = file.size < 1024 * 1000;if (!sizeOk) {this.$message.error('照片大小超过100K!');return}},handleChangeloginbig(info) {if (info.file.status === "done") {if (this.loginimageUrlbig.length < 9) {if (this.loginimageUrlbig[0] != "") {this.loginimageUrlbig.unshift("")}} else {this.loginimageUrlbig.shift()}let loCbig = this.URL + '/' + info.file.response.key;this.loginimageUrlbig.push(loCbig)if (loCbig) {// 获取文本编辑器let quill = this.$refs.myQuillEditor.quill// 获取光标位置let pos = quill.getSelection().index// 插入图片到光标位置quill.insertEmbed(pos, 'image', loCbig)} else {this.$essage.error('图片插入失败')}}},}}
</script><style scoped></style>
http://www.yidumall.com/news/73747.html

相关文章:

  • 专业的深圳网站建设公司哪家好磁力王
  • 怎么做应用成都seo达人
  • 潍坊网站建设500怎么申请一个网站
  • 网站建设免费空间注册导航百度关键词多少钱一个月
  • 南昌网站排名优化兰州网站开发公司
  • 滚动视差网站百度引擎搜索
  • 零食电子商务网站建设策划书搜索排行榜
  • 手机网站怎么做的好发软文的平台
  • iis网站开发北京网络推广外包公司排行
  • 腾讯做网站上传百度搜索智能精选
  • 重庆网站制作设计优化推广网站怎么做
  • 有网站源码去哪里做球队排名世界
  • 域名备案了 怎么建设网站seo外链优化方法
  • 后台管理系统网站模板百度手机卫士下载安装
  • 党政门户网站怎么做seo诊断工具有哪些
  • 红河公司 网站建设2345系统导航
  • 怎样让网站优化的方式站内推广和站外推广的区别
  • 成都知名建筑公司排名seo网站推广的主要目的不包括
  • 网站的收录情况怎么查石家庄疫情最新情况
  • 公司网站建设的意义时事新闻最新
  • 苏州好的做网站的公司哪家好竞价托管就选微竞价
  • 济南网站建设公司晟创未来线上运营的5个步骤
  • 网站备案初审时间百度打广告多少钱一个月
  • 网站的网络营销推广方案电商平台排行榜
  • 中文设计网站百度自动点击器怎么用
  • 乡政府网站建设方案上海培训机构排名榜
  • 吉安市网站制作ip切换工具
  • 青岛商城网站开发bt搜索引擎最好用的
  • 用dede做网站后台如何自己做网页
  • 网站开发手册阿里云搜索引擎网址