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

Vue基础27之VueUI组件

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
<template><div class="bg"><button>原生按钮</button><input type="text" placeholder="原生input框"><br> <br>
<!--    element-ui的引入--><el-button type="primary">主要按钮</el-button><div class="input"><el-input  placeholder="请输入内容"></el-input></div><br><el-button icon="el-icon-search" circle></el-button><br>
<!--    日期引入--><el-date-pickertype="daterange"align="right"unlink-panelsrange-separator=""start-placeholder="开始日期"end-placeholder="结束日期"></el-date-picker></div>
</template><script>
export default {name: "App",
}
</script><style>
.input{width: 200px;margin-top: 10px;
}
</style>

在这里插入图片描述

按需引入

安装 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

<template><div class="bg"><button>原生按钮</button><input type="text" placeholder="原生input框"><br> <br>
<!--    element-ui的引入--><el-row><el-button type="primary">主要按钮</el-button></el-row><div class="input"><el-input  placeholder="请输入内容"></el-input></div><el-row><el-button icon="el-icon-search" circle></el-button></el-row>
<!--    日期引入--><expecial-datePickertype="daterange"align="right"unlink-panelsrange-separator=""start-placeholder="开始日期"end-placeholder="结束日期"></expecial-datePicker></div>
</template><script>
export default {name: "App",
}
</script><style>
.input{width: 200px;margin-top: 10px;
}
</style>

在这里插入图片描述

http://www.lryc.cn/news/41487.html

相关文章:

  • 第35篇:Java代码规范全面总结
  • Cookie和Session详解
  • Linux之磁盘分区、挂载
  • web渗透之jwt 安全问题
  • 好用的5款国产低代码平台介绍
  • 【前端学习记录】webpack学习之mini-css-extract-plugin插件
  • FPGA基于RIFFA实现PCIE采集HDMI传输,提供工程源码和QT上位机
  • SpringBoot解析指定Yaml配置文件
  • C++基础算法③——排序算法(选择、冒泡附完整代码)
  • 《高质量C/C++编程》读书笔记一
  • 【完美解决】python flask如何直接加载html,css,js,image等下载的网页模板
  • 2023美赛C题【分析思路+代码】
  • 考研复试6 编译原理
  • uni-app:登录与支付--用户信息
  • Docker 部署 MySQL
  • 警惕,3月20日WOS目录更新,50本SCI/SSCI被剔除,这个出版社多达18本
  • 【 Linux入门 】之 手搓 命令行解释器 bash(带源码)
  • 【运维】运维常用命令
  • MYSQL常用命令大全
  • 锚点定位方案
  • Flink学习--第一章 初识Flink
  • 电脑技巧:常见的浏览器内核介绍
  • 【数据分析之道①】字符串
  • 网络安全之防火墙
  • STM32之点亮一个LED小灯(轮询法)
  • pandas读CSV、读JSON、Excel
  • 企业站项目
  • STM32开发(九)STM32F103 通信 —— I2C通信编程详解
  • 手撕数据结构—栈
  • 【java刷题】排序子序列