20220722_使用Element UI写html页面

Element官网component资源点击这里
结构图,element-ui自行下载复制到一致路径
请添加图片描述

第一个html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <el-row>
        <el-button>Default</el-button>
        <el-button type="primary">Primary</el-button>
        <el-button type="success">Success</el-button>
        <el-button type="info">Info</el-button>
        <el-button type="warning">Warning</el-button>
        <el-button type="danger">Danger</el-button>
    </el-row>

    <el-row>
        <el-button plain>Plain</el-button>
        <el-button type="primary" plain>Primary</el-button>
        <el-button type="success" plain>Success</el-button>
        <el-button type="info" plain>Info</el-button>
        <el-button type="warning" plain>Warning</el-button>
        <el-button type="danger" plain>Danger</el-button>
    </el-row>

    <el-row>
        <el-button round>Round</el-button>
        <el-button type="primary" round>Primary</el-button>
        <el-button type="success" round>Success</el-button>
        <el-button type="info" round>Info</el-button>
        <el-button type="warning" round>Warning</el-button>
        <el-button type="danger" round>Danger</el-button>
    </el-row>

    <el-row>
        <el-button icon="el-icon-search" circle></el-button>
        <el-button type="primary" icon="el-icon-edit" circle></el-button>
        <el-button type="success" icon="el-icon-check" circle></el-button>
        <el-button type="info" icon="el-icon-message" circle></el-button>
        <el-button type="warning" icon="el-icon-star-off" circle></el-button>
        <el-button type="danger" icon="el-icon-delete" circle></el-button>
    </el-row>
</div>

<script src="js/Vue.js"></script>
<script src="element-ui/lib/index.js"></script>
<link rel="stylesheet" href="element-ui/lib/theme-chalk/index.css">

<script>
    new Vue({
     
        el: "#app"

    })
</script>

</body>
</html>```

请添加图片描述
第二个

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <style>
        .el-row {
     
            margin-bottom: 20px;
        }
        .el-col {
     
            border-radius: 4px;
        }
        .bg-purple-dark {
     
            background: #99a9bf;
        }
        .bg-purple {
     
            background: #d3dce6;
        }
        .bg-purple-light {
     
            background: #e5e9f2;
        }
        .grid-content {
     
            border-radius: 4px;
            min-height: 36px;
        }
        .row-bg {
     
            padding: 10px 0;
            background-color: #f9fafc;
        }
    </style>

</head>
<body>
<div id="app">
    <el-row>
        <el-col :span="24"><div class="grid-content bg-purple-dark"></div></el-col>
    </el-row>
    <el-row>
        <el-col :span="12"><div class="grid-content bg-purple"></div></el-col>
        <el-col :span="12"><div class="grid-content bg-purple-light">
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要在HTML页面使用Element UI,需要按照以下步骤进行设置: 1. 首先,确保你已经引入了Vue.js。你可以通过在HTML页面中添加以下代码来引入Vue.js: ```html <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> ``` 2. 接下来,你需要下载并引入Element UI的CSS和JS文件。你可以从Element UI的官方网站(https://element.eleme.cn)下载文件,或者使用CDN链接。在HTML页面中添加以下代码引入Element UI的CSS和JS文件: ```html <!-- 引入Element UI的CSS文件 --> <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css"> <!-- 引入Element UI的JS文件 --> <script src="https://unpkg.com/element-ui/lib/index.js"></script> ``` 3. 确保Vue.jsElement UI的文件都已经引入后,你可以开始在HTML页面使用Element UI组件了。在Vue实例的`template`中,使用Element UI提供的组件标签即可。例如,要使用一个按钮组件,可以在`template`中添加以下代码: ```html <el-button type="primary">按钮</el-button> ``` 4. 最后,需要在Vue实例中注册Element UI的组件。你可以通过在Vue实例的`components`属性中注册所需的组件。例如,如果你要使用按钮组件,在Vue实例中添加以下代码: ```javascript new Vue({ el: '#app', components: { 'el-button': ElementUI.Button } }); ``` 这样,你就可以在HTML页面使用Element UI的组件了。记得将`#app`替换为你实际的根元素选择器。 希望对你有所帮助!如果还有其他问题,请继续提问。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值