一、easyplayer
1.npm安装EasyPlayer、copy-webpack-plugin
npm install @easydarwin/easyplayer --save
npm install copy-webpack-plugin@4.0.1 --save-dev
也可在package.json文件中直接添加版本号,然后执行yarn install 或 npm install:
"dependencies": {
"@easydarwin/easyplayer": "^5.0.3",
},
"devDependencies": {
"copy-webpack-plugin": "^4.0.1",
}
2.在vue.config.js文件中配置
const CopyWebpackPlugin = require('copy-webpack-plugin')
...
new CopyWebpackPlugin([
{ from: 'node_modules/@easydarwin/easyplayer/dist/component/EasyPlayer.wasm' },
{ from: 'node_modules/@easydarwin/easyplayer/dist/component/crossdomain.xml' },
{ from: 'node_modules/@easydarwin/easyplayer/dist/component/EasyPlayer-lib.min.js', to: 'js/' },
])
3.在public/index.html中引入js静态资源
注意:文件位置要与上面配置的to...相同,上面配置是的 to: 'js/',所以底下地址是./js
或
【vue中easyplayer使用】4.在vue中使用
...
import EasyPlayer from '@easydarwin/easyplayer'
...
components: { EasyPlayer }
推荐阅读
- elementui|java基于Springboot+vue的宠物销售商城网站 elementui
- elementui|基于Springboot+vue的化妆品美妆销售商城网站 elementui
- elementui|基于Springboot+vue的体用用品销售商城网站 elementui
- Vue|Vue第五天学习总结——Vue全家桶之前端工程化(模块化相关规范、webpack、Vue单文件组件、Vue脚手架、组件库——Element-UI 的基本使用)
- vue|vue-cli项目的webpack打包优化
- vue.js|项目vue-cli4打包以及优化
- vue.js|Vue——vue3中集成第三方框架、Vue 3项目中的性能优化(难点、不可或缺的)
- vue.js|vue 创建项目之后,我们需要做什么()
- vue.js|基于VUE和Node.js的医院挂号预约管理系统