Vue基础27之VueUI组件
创始人
2025-05-31 21:30:47

Vue基础27

  • Vue UI组件库
    • 移动端常用 UI 组件库
    • PC 端常用 UI 组件库
    • Element-ui插件
      • 基本使用
        • 安装
        • 引入并使用
          • main.js
          • App.vue
      • 按需引入
        • 安装 babel-plugin-component
        • babel.config.js
        • main.js
        • App.vue

Vue UI组件库

移动端常用 UI 组件库

  1. Vant

https://youzan.github.io/vant

  1. Cube UI

https://didi.github.io/cube-ui

  1. Mint UI

http://mint-ui.github.io

PC 端常用 UI 组件库

  1. Element UI

https://element.eleme.cn

  1. IView UI

https://www.iviewui.co

Element-ui插件

基于Vue框架的国产UI组件(饿了么出品)

基本使用

安装

npm i element-ui

在这里插入图片描述

引入并使用

main.js
import Vue from 'vue'import App from './App'//引入ElementUI组件库
import ElementUI from 'element-ui'
//引入ElementUI全部样式
import 'element-ui/lib/theme-chalk/index.css';//关闭vue的生产提示
Vue.config.productionTip = false//应用ElementUI
Vue.use(ElementUI)
new Vue({el: "#app",render: h => h(App),
})
App.vue

在这里插入图片描述

按需引入

安装 babel-plugin-component

npm install babel-plugin-component -D

babel.config.js

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

main.js

import Vue from 'vue'import App from './App'// //引入ElementUI组件库
// import ElementUI from 'element-ui'
// //引入ElementUI全部样式
// import 'element-ui/lib/theme-chalk/index.css';//关闭vue的生产提示
Vue.config.productionTip = false//按需引入
import{Button,Row,DatePicker,Input} from "element-ui";// //应用ElementUI
// Vue.use(ElementUI)
Vue.component(Button.name,Button)
Vue.component(Row.name,Row)
Vue.component(Input.name,Input)
Vue.component('expecial-datePicker',DatePicker)new Vue({el: "#app",render: h => h(App),
})

App.vue

在这里插入图片描述

上一篇:lgsvl 现状

下一篇:(Java)付账问题

相关内容

热门资讯

签证申请线上办理攻略 现在出国旅游、出差的人越来越多,签证办理作为第一道门槛,不少人还是会犯怵。其实现在线上办理签证早就不...
抢鲜看!南京超大室内游乐场来了 12月15日,位于洪武路的Suning Fun南京新街口店正加紧装修中,目前已进入收尾冲刺阶段,预计...
福建武夷山:举行第六届1938... 12月15日,工作人员在第六届1938.“正岩”杯茶王赛上冲泡茶叶。(邱汝泉 摄) 当日,由福建省武...
政和功夫茶 政和功夫,与坦洋功夫、白琳功夫并称为“福建省三大功夫红茶”,而政和功夫又是这三大功夫茶中的上品,也是...
原创 特... 在河北南部和河南北部的许多家庭里,有一道听起来普通却风味独特的家常菜——皮渣煎鸡蛋。这道菜将当地特色...