ElementUI入门

ElementUI

常用组件
(1)Container布局容器(用于页面布局)
(2)Dropdown下拉菜单(用于首页退出菜单)
(3)NavMenu导航菜单(用于左侧菜单)
(4)Tabel表格(用于列表展示)
(5)Pagination分页(用于列表分页展示)
(6)Message消息提示(用于保存、修改、删除的时候成功或失败提示)
(7)Tabs标签页(用于一个页面多个业务功能)
(8)Form表单(新增、修改时的表单,及表单验证)

入门案例:
<!DOCTYPE html>
<html>
	<head>
	  <meta charset="UTF-8">
	  <!-- import CSS -->
	  <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
	</head>
	
	<body>
	  <div id="app">
	    <el-button @click="fun">Button</el-button>
	    <el-dialog :visible.sync="visible" title="Hello world">
	      <p>尚硅谷</p>
	    </el-dialog>
	  </div>
	</body>

	  <!-- import Vue before Element -->
	  <script src="https://unpkg.com/vue/dist/vue.js"></script>
	  <!-- import JavaScript -->
	  <script src="https://unpkg.com/element-ui/lib/index.js"></script>
	  
	  <script>
	    new Vue({
   
	      el: '#app',
	      data: {
   
	        visible: false 
	      },
	      methods:{
   
	      	 fun:function(){
   
	      	 	this.visible = true
	      	 }
	      	 
	      }
	    })
	  </script>
  
</html>

常用组件

Container 布局容器

用于布局的容器组件,方便快速搭建页面的基本结构:

在这里插入图片描述
:外层容器。当子元素中包含 或 时,全部子元素会垂直上下排列,否则会水平左右排列
:顶栏容器
:侧边栏容器
:主要区域容器
:底栏容器

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<!-- 引入ElementUI样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<!-- 引入ElementUI组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<style>
    .el-header, .el-footer {
   
        background-color: #B3C0D1;
        color: #333;
        text-align: center;
        line-height: 60px;
    }

    .el-aside {
   
        background-color: #D3DCE6;
        color: #333;
        text-align: center;
        line-height: 200px;
    }

    .el-main {
   
        background-color: #E9EEF3;
        color: #333;
        text-align: center;
        line-height: 160px;
    }

    body > .el-container {
   
        margin-bottom: 40px;
    }

    .el-container:nth-child(5) .el-aside,
    .el-container:nth-child(6) .el-aside {
   
        line-height: 260px;
    }

    .el-container:nth-child(7) .el-aside {
   
        line-height: 320px;
    }
</style>
<body>
    <div id="app">
        <el-container>
            <el-header>
                标题
            </el-header>
            <el-container>
                <el-aside width="200px">
                    菜单
                </el-aside>
                <el-container>
                    <el-main>
                        功能区域
                    </el-main>
                    <el-footer>
                        底部
                    </el-footer>
                </el-container>
            </el-container>
        </el-container>
    </div>
</body>
</html>
<script>
    new Vue({
   
        el:"#app"
    })
</script>

Dropdown 下拉菜单

将动作或菜单折叠到下拉菜单中。
• 方式一:hover激活事件

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<!-- 引入ElementUI样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<!-- 引入ElementUI组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<style>
    .el-dropdown-link {
   
        cursor: pointer;
        color: #409EFF;
    }
    .el-icon-arrow-down {
   
        font-size: 12px;
    }
</style>
<body>
    <div id="app">
        <el-dropdown>
    
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

明月常新

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值