vue项目使用element组件:
https://www.bilibili.com/video/BV17m4y1Q7gn?p=3&vd_source=f14ec4eade17b415c4cffe719ac753d6
可以用vue ui新建vue项目,更改配置,下载element插件,参考链接:
https://blog.csdn.net/weixin_46483006/article/details/125856743?spm=1001.2014.3001.5502
以icon图标为例:
npm run serve运行就可以啦:
html使用element组件:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<script src="https://cdn.staticfile.org/vue/2.4.2/vue.min.js"></script>
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
</head>
<body>
<div id="app">
</div>
<script>
new Vue({
el: '#app',
data: function() {
return {
visible: false,
num: 0,
}
},
created() {
this.fun()
},
methods: {
fun() {
if (this.num >= 100) return
setTimeout(() => {
this.num += 20
this.fun()
}, 1000)
}
}
})
</script>
</body>
</html>
找到element组件库文档:
https://element.eleme.cn/#/zh-CN/component/table
以表格为例:
就可以啦: