目录
gitee仓库地址:https://gitee.com/CMD-UROOT/sph-project/commits/master
2.4为了使用ElementUI有代码提示,我们安装一个vue-helper
4.1 在main.js中引入注册MessageBox编辑
gitee仓库地址:https://gitee.com/CMD-UROOT/sph-project/commits/master
大家根据上传历史进行查找你需要的代码
业务需求1:
点击支付按钮弹出遮罩层
我们知道的UI组件库有下图这些常用的,今天我们利用ElementUI来实现业务
1.安装ElementUi
官网:Element - The world's most popular Vue UI framework
控制台输入:
npm install --save element-ui
2.引入ElementUI
引入有两种方式,按需引入和完整引入
因为我们这里只需要一个遮罩层,所以我们这里引入方式选择按需引入
官网查看引入方式:Element - The world's most popular Vue UI framework
2.1按需引入
首先,安装 babel-plugin-component:
控制台输入:
npm install babel-plugin-component -D
然后,将 .babelrc 修改为:
.babelrc相当于我们的babel.config.js文件:
在babel.config.js文件中:
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
],
"plugins": [
[
"component"