惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Schneier on Security
有赞技术团队
有赞技术团队
T
The Blog of Author Tim Ferriss
F
Fortinet All Blogs
D
DataBreaches.Net
F
Full Disclosure
腾讯CDC
博客园 - 【当耐特】
MyScale Blog
MyScale Blog
Stack Overflow Blog
Stack Overflow Blog
小众软件
小众软件
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
爱范儿
爱范儿
The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
SegmentFault 最新的问题
The Register - Security
The Register - Security
WordPress大学
WordPress大学
博客园 - 聂微东
雷峰网
雷峰网
J
Java Code Geeks
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Privacy International News Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
A
Arctic Wolf
Scott Helme
Scott Helme
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tor Project blog
博客园 - 三生石上(FineUI控件)
Know Your Adversary
Know Your Adversary
AWS News Blog
AWS News Blog
G
Google Developers Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
CERT Recently Published Vulnerability Notes
O
OpenAI News
Project Zero
Project Zero
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Application and Cybersecurity Blog
Application and Cybersecurity Blog
云风的 BLOG
云风的 BLOG
N
News and Events Feed by Topic
MongoDB | Blog
MongoDB | Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Microsoft Security Blog
Microsoft Security Blog
Cisco Talos Blog
Cisco Talos Blog
P
Palo Alto Networks Blog
Schneier on Security
Schneier on Security

博客园 - sunwugang

026.数据库Sqlserver解决远程连接问题 C# SqlSuger C# DataTableToList 批处理自动删除指定文件夹中的文件夹以及文件 C# 开机自启动批处理bat文件 C# 将exe可执行程序设置为开机自启动 025.数据库下载&win10安装注意事项 024 数据库信息查询 + 连接串配置 C# Json操作 C# TextBox 新增文本并定位光标 C# base64转pdf + 上传至指定url C# 猜字谜 C# 闲来笔记 StringHelper--字符串左右添加指定字符 Vue学习笔记71--histroy模式+hash模式 Vue学习笔记70--全局前置-路由守卫 + 后置路由守卫 + 独享守卫 + 组件内守卫 Vue学习笔记69--activated + deactivated Vue学习笔记68--缓存路由组件 Vue学习笔记67--编程式路由导航
Vue学习笔记72--element ui
sunwugang · 2024-04-02 · via 博客园 - sunwugang

Vue UI 组件库:https://element.eleme.cn

移动端常用UI组件库

  1. Vant:https://youzan.github.io/vant
  2. Cube UI:https://didi.github.io/cube-ui
  3. Mint UI:https://mint-ui.github.io
  4. NUTUI
  5. 。。。。。。

PC端常用UI组件库

  1. Element UI:https://element.eleme.cn
  2. IView UI:https://www.iviewui.com

Element UI

第一步:安装,npm i element-ui -S

第二步:按需引入,npm install babel-plugin-component -D

第三步:babel.config.js配置

 1 module.exports = {
 2   presets: [
 3     '@vue/cli-plugin-babel/preset',
 4     // [["es2015", { "modules": false }]],  版本太老
 5     ["@babel/preset-env", { "modules": false }],
 6   ],
 7   "plugins": [
 8     [
 9       "component",
10       {
11         "libraryName": "element-ui",
12         "styleLibraryName": "theme-chalk"
13       }
14     ]
15   ]
16 }

第四步:按需引入 Element(请查看:https://element.eleme.cn/#/zh-CN/component/quickstart)

1 import Vue from 'vue';
2 import { Button } from 'element-ui';
3 
4 Vue.prototype.$ELEMENT = { size: 'small', zIndex: 3000 };
5 Vue.use(Button);

。。。。。。

element ui 版本安装控制操作步骤:

  1. 卸载element-ui:npm uninstall element-ui
  2. 安装element-ui 指定版本:npm i element-ui@2.15.7
  3. 安装最新版本:npm i element-ui -S

示例如下所示:

注:图中警告信息,是因为没有应用<el-row> 组件(该问题在示例代码中已处理)

main.js

 1 // 引入Vue
 2 import Vue from 'vue'
 3 // 引入App
 4 import App from './App.vue'
 5 
 6 // 按需引入
 7 import { Button, Select, Row } from 'element-ui';
 8 /* Vue.component(Button.name, Button);
 9 Vue.component(Select.name, Select); */
10 Vue.use(Button)
11 Vue.use(Select)
12 Vue.use(Row)
13 Vue.prototype.$ELEMENT = { size: 'small', zIndex: 3000 };
14 
15 /* 完整引入
16 import ElementUI from 'element-ui'
17 import 'element-ui/lib/theme-chalk/index.css'
18 Vue.use(ElementUI); */
19 
20 // 配置提示
21 Vue.config.productionTip = false
22 
23 new Vue({
24   render: h => h(App)
25 }).$mount('#app')

App.vue

 1 <template>
 2   <div>
 3     <el-row>
 4       <el-button>默认按钮</el-button>
 5       <el-button type="primary">主要按钮</el-button>
 6       <el-button type="success">成功按钮</el-button>
 7       <el-button type="info">信息按钮</el-button>
 8       <el-button type="warning">警告按钮</el-button>
 9       <el-button type="danger">危险按钮</el-button>
10     </el-row>
11     <br><br>
12     <el-row>
13       <el-button plain>朴素按钮</el-button>
14       <el-button type="primary"
15                  plain>主要按钮</el-button>
16       <el-button type="success"
17                  plain>成功按钮</el-button>
18       <el-button type="info"
19                  plain>信息按钮</el-button>
20       <el-button type="warning"
21                  plain>警告按钮</el-button>
22       <el-button type="danger"
23                  plain>危险按钮</el-button>
24     </el-row>
25     <br><br>
26     <el-row>
27       <el-button round>圆角按钮</el-button>
28       <el-button type="primary"
29                  round>主要按钮</el-button>
30       <el-button type="success"
31                  round>成功按钮</el-button>
32       <el-button type="info"
33                  round>信息按钮</el-button>
34       <el-button type="warning"
35                  round>警告按钮</el-button>
36       <el-button type="danger"
37                  round>危险按钮</el-button>
38     </el-row>
39     <br><br>
40     <el-row>
41       <el-button icon="el-icon-search"
42                  circle></el-button>
43       <el-button type="primary"
44                  icon="el-icon-edit"
45                  circle></el-button>
46       <el-button type="success"
47                  icon="el-icon-check"
48                  circle></el-button>
49       <el-button type="info"
50                  icon="el-icon-message"
51                  circle></el-button>
52       <el-button type="warning"
53                  icon="el-icon-star-off"
54                  circle></el-button>
55       <el-button type="danger"
56                  icon="el-icon-delete"
57                  circle></el-button>
58     </el-row>
59   </div>
60 
61 </template>
62 
63 <script>
64 export default {
65   name: 'App',
66   components: {}
67 }
68 </script>
69 
70 <style scoped>
71 </style>