# 框架集成
# eslint用于代码规范校验 以及prettierrr用于代码格式统一
``` js
npm install eslint eslint-config-prettier eslint-plugin-vue eslint-plugin-prettier @typescript-eslint/eslint-plugin @typescript-eslint/parser vite-plugin-eslint --save-dev
```
# css 集成:使用UnoCSS原子化CSS
## unocss查询网址
https://www.tailwindcss.cn/docs/installation
https://uno.antfu.me/
## 图标网址
https://icones.netlify.app/
https://iconify.design/
``` js
npm install @unocss/preset-icons unocss @iconify/json --save-dev
```
# Vue3自适应瀑布流 --vue-masonry
```js
1.安装
npm install vue-masonry --save
2. main.js
import {VueMasonryPlugin} from 'vue-masonry';
app.use(VueMasonryPlugin)
属性说明
item-selector=".item" -列表元素DOM项目选择器
transition-duration="0.3s -过渡期
column-width="#test"-列宽的元素选择器。可以是选择器字符串或数字
origin-left="false" -设置为将元素分组到右侧而不是默认情况下的左侧
gutter=".gutter-block-selector"-指定[项目元素之间的水平间距
fit-width="true" -设置容器的宽度以适合可用的列数
horizontal-order="true" -布置物品以(大部分)保持水平的从左到右的顺序
```
3.组件使用
```vue
<template>
<div style="width: 100%; margin: auto">
<div
v-masonry
fit-width="true"
transition-duration="0.3s"
item-selector=".card"
origin-left="false"
class="pets"
>
<div v-masonry-tile v-for="pet in resultList" :key="pet.id" class="card">
<el-card>
<div>{{ pet.title }}</div>
</el-card>
</div>
</div>
</div>
</template>
<script setup name="ProjectList">
const resultList = ref([
{
id: 'B9B41B5CCCF54A0A8A5BFC69A15A2E1A',
title:'测试1'
},
{
id: 'B9B41B5CCCF54A0A8A5BF',
title:'测试2'
}
])
</script>
<style scoped lang="scss">
.card {
width: 100%;
max-width: 250px;
margin: 0.25em;
}
</style>
```
# 编辑器整合
## TinyMCE 上传视频 是编写地址的
## Quill 上传视频 是编写地址的;图片上传没有限制图片大小(要结合插件,但是插件不好整合vite)
## WangEditor
``` js
1. 上传视频 源码有问题,修改修改源码【依赖包makereditor或者zhangeditor(别人的)】
2. 网络上传图片【图片能访问的 才可以上传】
3. customUpload自定义上传跟插件自带的上传工具 2个不能一起用
const editorConfig = {
placeholder: '请输入内容1...',
MENU_CONF: {
// 上传本地图片
uploadImage: {
/**插件自定义事件 start */
server: 'http://192.168.3.56:81/dev-api/file/attachFile/attachUpload',
fieldName: 'file',
maxFileSize: 1 * 1024 * 1024, // 1M
allowedFileTypes: ['.jpg, .png, .gif, .jpeg'],
base64LimitSize: 5 * 1024,
maxNumberOfFiles: 1,
headers: {
Authorization:
'Bearer ' +
'eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6ImE0NDg4OTJjLTBiMTYtNDg0YS05MTM2LTc4YzBmZWY4N2Y1MSIsInVzZXJuYW1lIjoiYWRtaW4ifQ.KZCY_ye9WQf00rYQR8ECHGiOaIRRBllvmCu3-8haLcZ27IOjOiuTc1fYjvS0G82NbD0S8raTWOcpFYW-iCxaEA'
},
customInsert(res, insertFn) {
console.log(editorRef.value.getConfig(), '-22--')
console.log('customInsert', res)
const imgInfo = res.data || {}
const { url } = imgInfo
insertFn(url)
},
// 单个文件上传失败
onFailed(file, res) {
console.log(`${file.name} 上传失败`, res)
},
onSuccess(file, res) {
console.log(`${file.name} 上传成功`, res)
},
// 上传错误,或者触发 timeout 超时
onError(file, err, res) {
proxy.$modal.msgError(res)
console.log(res)
}
/**插件自定义事件 end*/
/**自定义上传功能
*
* @param {*} file 文件
* @param {*} insertFn 输入到编辑器
*/
// customUpload(file, insertFn) {
// console.log(editorRef.value.getConfig(), '---')
// // if (file.size / 1024 / 1024 > 5) {
// // proxy.$modal.msgError('单个文件不能超过5MB!')
// // return false
// // }
// // // 把图片转成base64
// // getBase64(file, url => {
// // insertFn(url)
// // })
// }
}
}
}
const toolbarConfig = {
// 配置 toolbar 的工具
toolbarKeys: []
}
// 富文本框内容校验
checkEditor(str) {
if (!str) {
return;
}
// str = str.replace(/<\/?[^>]*>/g, ''); //去除HTML tag
str = str.replace(/[ | ]*\n/g, '\n'); //去除行尾空白
// str = str.replace(/[ ]|[ ]/g, '');//去除
// str = str.replace(/ /ig, '');//去掉
// console.log(str);
return str;
}
```
音频:http://192.168.1.110:9000/attach/2023/07/03/音频_20230703152644A214.mp3 https://www.runoob.com/try/demo_source/horse.mp3
视频:http://192.168.1.110:9000/attach/2023/07/03/视频_20230703152728A215.mp4 https://www.runoob.com/try/demo_source/movie.ogg
图片:https://img2.baidu.com/it/u=3329909248,3799019568&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500
## v-md-editor 没有上传视频
npm i makereditor --save-dev
npm install @wangeditor/editor-for-vue@next --save
npm install @wangeditor/editor --save
图片:
本地上传 图片 有请求接口 :存在素材库
没有合适的资源?快使用搜索试试~ 我知道了~
vue3+wangEditor5自定义上传音频+视频
共297个文件
js:91个
svg:87个
vue:84个
需积分: 3 13 下载量 185 浏览量
2023-07-05
13:41:54
上传
评论
收藏 1.24MB RAR 举报
温馨提示
wangEditor5用在Vue3中自定义扩展音频、视频、图片菜单;并扩展音频元素节点,保证音频节点的插入、读取、回写功能正常;支持动态修改尺寸
资源推荐
资源详情
资源评论
收起资源包目录
vue3+wangEditor5自定义上传音频+视频 (297个子文件)
package.bat 156B
build.bat 117B
run-web.bat 112B
.env.development 264B
.editorconfig 257B
.eslintignore 483B
401.gif 160KB
.gitignore 279B
ie.html 23KB
index.html 5KB
favicon.ico 6KB
login-background.jpg 509KB
profile.jpg 79KB
index.js 9KB
ruoyi.js 6KB
tagsView.js 6KB
request.js 6KB
index.js 5KB
AudioMenu.js 5KB
permission.js 4KB
MyModalMenu.js 3KB
setConfig.js 3KB
.eslintrc.js 3KB
main.js 3KB
user.js 3KB
PreviewPage.js 3KB
validate.js 2KB
user.js 2KB
role.js 2KB
index.js 2KB
vite.config.js 2KB
download.js 2KB
role.js 2KB
tab.js 2KB
user.js 2KB
notice.js 2KB
permission.js 2KB
modal.js 2KB
scroll-to.js 2KB
MaterialVideo.js 2KB
MaterialImage.js 2KB
copyText.js 2KB
auth.js 2KB
cache.js 1KB
gen.js 1KB
settings.js 1KB
dept.js 1KB
gen.js 1KB
theme.js 1KB
permission.js 1KB
job.js 1KB
dict.js 1KB
app.js 1KB
jsencrypt.js 1KB
job.js 1KB
cache.js 1KB
config.js 1KB
login.js 1KB
type.js 1KB
cache.js 1KB
menu.js 1KB
config.js 1KB
type.js 1KB
index.js 1KB
menu.js 1KB
data.js 1019B
data.js 967B
dept.js 959B
login.js 950B
settings.js 904B
compression.js 889B
notice.js 799B
MySelectMenu.js 792B
post.js 773B
hasPermi.js 744B
dict.js 741B
post.js 729B
logininfor.js 696B
hasRole.js 675B
logininfor.js 658B
index.js 524B
jobLog.js 509B
operlog.js 504B
jobLog.js 480B
operlog.js 475B
dynamicTitle.js 420B
customAlert.js 418B
online.js 353B
online.js 333B
svg-icon.js 323B
index.js 291B
auth.js 286B
svgicon.js 285B
auto-import.js 256B
requireIcons.js 225B
index.js 211B
errorCode.js 206B
index.js 204B
server.js 170B
menu.js 169B
共 297 条
- 1
- 2
- 3
资源评论
面条请不要欺负汉堡
- 粉丝: 8457
- 资源: 24
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功