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

Vue组件库Element-ui

Vue组件库Element-ui

Element是一套为开发者、设计师和产品经理准备的基于Vue2.0的桌面端组件库。Element - 网站快速成型工具

安装element-ui

npm install element-ui # element-ui@版本(可以指定版本号

引入ElementUI组件库,在main.js中添加内容得到:

import Vue from 'vue'
import App from './App.vue'
import router from './router'
// 引入element-ui
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.config.productionTip = false

// 使用element-ui
Vue.use(ElementUI);
new Vue({
  router,
  render: h => h(App)
}).$mount('#app')

在App.vue中进行修改如下:

<template>
  <div>
    <ElementView></ElementView>
  </div>
</template>

<script>
import ElementView from './views/ElementView.vue';

  export default {
    components: {
      ElementView
    },
    data() {
      return {
        msg: 'Welcome to Your Vue.js App'
      }
    },
    mounted() {
      console.log('App.vue mounted');
  }
}
</script>
<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

nav {
  padding: 30px;
}

nav a {
  font-weight: bold;
  color: #2c3e50;
}

nav a.router-link-exact-active {
  color: #42b983;
}
</style>

在这里插入图片描述


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

相关文章:

  • vscode显示.vscode文件
  • 【linux开发-Qt】-信号与槽机制
  • unity ps 2d animation 蛇的制作
  • SQL 自学:表别名的运用与对被联结表使用聚集函数
  • 《C++与简单人工智能算法:开启智能编程之旅》
  • Maven(5)Maven的生命周期是什么?
  • java.util.function Function<T, R>
  • 机器学习中的多模态学习:用C/C++实现高效模型
  • 【SpringBoot详细教程】-11-SpringBoot整合Async 实现异步调用【持续更新】
  • 【Linux】多进程服务器模型(第十九篇)
  • Linux相关概念和易错知识点(14)(进程终止、进程退出、退出信息)
  • Patroni配置文件4-重要规则
  • Java中注解与反射的详细介绍
  • C# 结构体(Struct)
  • 0基础学习CSS(二十二)伪元素
  • 自动化的抖音
  • 算法:反转链表
  • Colorize: 0 variables Colorize is not activated for this file. VsCode
  • 【GeekBand】C++设计模式笔记7_Bridge_桥接模式
  • 惠普电脑怎么开启vt_惠普电脑开启vt虚拟化图文教程(支持新旧bios开启方法)