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

Vue83 引入elementUI

笔记

  • 安装插件
    在这里插入图片描述
  • 安装按需引入插件
    在这里插入图片描述

代码

在这里插入图片描述### App.vue

<template>
  <div>
		<button>原生的按钮</button>
		<input type="text">
		<atguigu-row>
			<atguigu-button>默认按钮</atguigu-button>
			<atguigu-button type="primary">主要按钮</atguigu-button>
			<atguigu-button type="success">成功按钮</atguigu-button>
			<atguigu-button type="info">信息按钮</atguigu-button>
			<atguigu-button type="warning">警告按钮</atguigu-button>
			<atguigu-button type="danger">危险按钮</atguigu-button>
		</atguigu-row>
		<atguigu-date-picker
      type="date"
      placeholder="选择日期">
    </atguigu-date-picker>
		<atguigu-row>
			<atguigu-button icon="el-icon-search" circle></atguigu-button>
			<atguigu-button type="primary" icon="el-icon-s-check" circle></atguigu-button>
			<atguigu-button type="success" icon="el-icon-check" circle></atguigu-button>
			<atguigu-button type="info" icon="el-icon-message" circle></atguigu-button>
			<atguigu-button type="warning" icon="el-icon-star-off" circle></atguigu-button>
			<atguigu-button type="danger" icon="el-icon-delete" circle></atguigu-button>
		</atguigu-row>
  </div>
</template>

<script>
	export default {
		name:'App',
	}
</script>

main.js

//引入Vue
import Vue from 'vue'
//引入App
import App from './App.vue'

//完整引入
//引入ElementUI组件库
// import ElementUI from 'element-ui';
//引入ElementUI全部样式
// import 'element-ui/lib/theme-chalk/index.css';

//按需引入
import { Button,Row,DatePicker } from 'element-ui';

//关闭Vue的生产提示
Vue.config.productionTip = false

//应用ElementUI
// Vue.use(ElementUI);
Vue.component('atguigu-button', Button);
Vue.component('atguigu-row', Row);
Vue.component('atguigu-date-picker', DatePicker);

//创建vm
new Vue({
	el:'#app',
	render: h => h(App),
})

babel.config.js

module.exports = {
  presets: [
    '@vue/cli-plugin-babel/preset',
		["@babel/preset-env", { "modules": false }],
  ],
	plugins:[
    [
      "component",
      {
        "libraryName": "element-ui",
        "styleLibraryName": "theme-chalk"
      }
    ]
  ]
}

在这里插入图片描述vue脚手架升级,已经不存在 .babelrc 文件,改为babel.config.js文件

运行

在这里插入图片描述


http://www.kler.cn/news/336254.html

相关文章:

  • CSS 布局——清除浮动 (二)
  • hutool bug
  • 核心理论框架对比:如何通过TOGAF实现企业数字化转型的全面战略
  • javaweb-分层解耦
  • 接口怎么返回文件或数据流,@RequestMapping注解里面的属性项有哪些
  • 计算机组成原理(笔记6阵列乘法器、补码阵列乘法器)
  • Nuxt.js 应用中的 app:beforeMount 钩子详解
  • 18年408数据结构
  • 论文笔记:微表情欺骗检测
  • FineReport 11 在线学习
  • INS风格时尚自拍人像摄影后期Lr调色,手机滤镜PS+Lightroom预设下载!
  • Android阶段学习思维导图
  • pytorch中的TensorDataset和DataLoader
  • 红外画面空中目标检测系统源码分享
  • LeetCode讲解篇之139. 单词拆分
  • JS模块化工具requirejs详解
  • webpack/vite的区别
  • Oracle架构之物理存储之日志文件
  • 计算机毕业设计 基于Python的智能文献管理系统的设计与实现 Python+Django+Vue 前后端分离 附源码 讲解 文档
  • 【图像处理】多幅不同焦距的同一个物体的平面图象,合成一幅具有立体效果的单幅图像原理(一)