Vue组件库Element-ui

Vue组件库Element-ui

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

安装element-ui

shell 复制代码
npm install element-ui # element-ui@版本(可以指定版本号

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

javascript 复制代码
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中进行修改如下:

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>
相关推荐
初遇你时动了情1 小时前
css中backdrop-filter 详细使用 ios毛玻璃效果、filter和backdrop-filter使用说明
前端·css
景彡先生2 小时前
Python Selenium详解:从入门到实战,Web自动化的“瑞士军刀”
前端·python·selenium
Liudef064 小时前
DeepseekV3.2 实现构建简易版Wiki系统:从零开始的HTML实现
前端·javascript·人工智能·html
景早5 小时前
vue 记事本案例详解
前端·javascript·vue.js
wangjialelele6 小时前
Qt中的常用组件:QWidget篇
开发语言·前端·c++·qt
乔冠宇7 小时前
vue需要学习的点
前端·vue.js·学习
用户47949283569157 小时前
同样是 #,锚点和路由有什么区别
前端·javascript
Hero_11277 小时前
在pycharm中install不上需要的包
服务器·前端·pycharm
爱上妖精的尾巴7 小时前
5-26 WPS JS宏数组元素添加删除应用
开发语言·前端·javascript·wps·js宏
是谁眉眼7 小时前
wpsapi
前端·javascript·html