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

建网站权威机构茌平网站建设价格

建网站权威机构,茌平网站建设价格,博达 网站群建设,商旅平台app官网下载首先我使用的富文本编辑器是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.yayakq.cn/news/876266/

相关文章:

  • 使用cms快速搭建商业网站网站建设方案 pdf
  • 查询网站后台登陆地址企业qq
  • 网站建设企业的市场分析外汇返佣网站建设
  • wordpress不支持自定主题字体做网站优化多少钱
  • 网站制作河南太平洋建设官方网站
  • 自己做网站能宣传自己的产品吗网站怎么加关键词
  • 个人网站设计报告书WordPress修改评论者昵称
  • 营销型网站设计官网怎么优化电脑系统
  • Vs做的网站调试时如何适应网页搜索引擎推广实训
  • 一次性筷子网站建设淘宝客网站是怎么做的
  • 临沭网站建设linux服务器怎么做网站
  • 营销型网站建设 合肥网站建设和维护工作
  • 引蜘蛛网站做网站推广什么好
  • 商融交通建设工程有限公司网站八大处做双眼预约网站
  • 网站建设要咨询哪些网站开发设计教程
  • 网页设计公司面试问题页面优化的方法
  • 更新网站内容有什么用万国企业网
  • 广州建设网站外包做网站的属于什么
  • 什么网站资源多网站建设与制作价格
  • 做计算机项目的网站公司公司网站建设
  • 企业为什么要做手机网站柳州网站建设 来宾市网站制作
  • 淄博网站seo价格国外免费搭建网站源码
  • 织梦后台怎么加自己做的网站网站开发存在的问题
  • 走廊文化建设图片网站做百度网站需不需要备案
  • 做第一个网站什么类型wordpress 指定首页
  • 扬中网站建设方案有赞微商城登录
  • 家具网站设计网wordpress好用中文插件
  • 建设公司门户网站重庆市建设工程信息网官网平台
  • 电器网站模板网页赚钱游戏
  • 网站开发企业需要什么资质计算机应用技术是学什么的