20220722_使用Element UI写html页面

2023-11-06

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"></div></el-col>
    </el-row>
    <el-row>
        <el-col :span="8"><div class="grid-content bg-purple"></div></el-col>
        <el-col :span="8"><div class="grid-content bg-purple-light"></div></el-col>
        <el-col :span="8"><div class="grid-content bg-purple"></div></el-col>
    </el-row>
    <el-row>
        <el-col :span="6"><div class="grid-content bg-purple"></div></el-col>
        <el-col :span="6"><div class="grid-content bg-purple-light"></div></el-col>
        <el-col :span="6"><div class="grid-content bg-purple"></div></el-col>
        <el-col :span="6"><div class="grid-content bg-purple-light"></div></el-col>
    </el-row>
    <el-row>
        <el-col :span="4"><div class="grid-content bg-purple"></div></el-col>
        <el-col :span="4"><div class="grid-content bg-purple-light"></div></el-col>
        <el-col :span="4"><div class="grid-content bg-purple"></div></el-col>
        <el-col :span="4"><div class="grid-content bg-purple-light"></div></el-col>
        <el-col :span="4"><div class="grid-content bg-purple"></div></el-col>
        <el-col :span="4"><div class="grid-content bg-purple-light"></div></el-col>
    </el-row>

    <!--
        添加一行,8个格子  24/8 = 3
    -->

    <el-row>
        <el-col :span="3"><div class="grid-content bg-purple"></div></el-col>
        <el-col :span="3"><div class="grid-content bg-purple-light"></div></el-col>
        <el-col :span="3"><div class="grid-content bg-purple"></div></el-col>
        <el-col :span="3"><div class="grid-content bg-purple-light"></div></el-col>
        <el-col :span="3"><div class="grid-content bg-purple"></div></el-col>
        <el-col :span="3"><div class="grid-content bg-purple-light"></div></el-col>
        <el-col :span="3"><div class="grid-content bg-purple"></div></el-col>
        <el-col :span="3"><div class="grid-content bg-purple-light"></div></el-col>
    </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-header {
            background-color: #B3C0D1;
            color: #333;
            line-height: 60px;
        }

        .el-aside {
            color: #333;
        }
    </style>

</head>
<body>
<div id="app">
    <el-container style="height: 500px; border: 1px solid #eee">
        <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
            <el-menu :default-openeds="['1', '3']">
                <el-submenu index="1">
                    <template slot="title"><i class="el-icon-message"></i>Navigator One</template>
                    <el-menu-item-group>
                        <template slot="title">Group 1</template>
                        <el-menu-item index="1-1">Option 1</el-menu-item>
                        <el-menu-item index="1-2">Option 2</el-menu-item>
                    </el-menu-item-group>
                    <el-menu-item-group title="Group 2">
                        <el-menu-item index="1-3">Option 3</el-menu-item>
                    </el-menu-item-group>
                    <el-submenu index="1-4">
                        <template slot="title">Option4</template>
                        <el-menu-item index="1-4-1">Option 4-1</el-menu-item>
                    </el-submenu>
                </el-submenu>
                <el-submenu index="2">
                    <template slot="title"><i class="el-icon-menu"></i>Navigator Two</template>
                    <el-menu-item-group>
                        <template slot="title">Group 1</template>
                        <el-menu-item index="2-1">Option 1</el-menu-item>
                        <el-menu-item index="2-2">Option 2</el-menu-item>
                    </el-menu-item-group>
                    <el-menu-item-group title="Group 2">
                        <el-menu-item index="2-3">Option 3</el-menu-item>
                    </el-menu-item-group>
                    <el-submenu index="2-4">
                        <template slot="title">Option 4</template>
                        <el-menu-item index="2-4-1">Option 4-1</el-menu-item>
                    </el-submenu>
                </el-submenu>
                <el-submenu index="3">
                    <template slot="title"><i class="el-icon-setting"></i>Navigator Three</template>
                    <el-menu-item-group>
                        <template slot="title">Group 1</template>
                        <el-menu-item index="3-1">Option 1</el-menu-item>
                        <el-menu-item index="3-2">Option 2</el-menu-item>
                    </el-menu-item-group>
                    <el-menu-item-group title="Group 2">
                        <el-menu-item index="3-3">Option 3</el-menu-item>
                    </el-menu-item-group>
                    <el-submenu index="3-4">
                        <template slot="title">Option 4</template>
                        <el-menu-item index="3-4-1">Option 4-1</el-menu-item>
                    </el-submenu>
                </el-submenu>
            </el-menu>
        </el-aside>

        <el-container>
            <el-header style="text-align: right; font-size: 12px">
                <el-dropdown>
                    <i class="el-icon-setting" style="margin-right: 15px"></i>
                    <el-dropdown-menu slot="dropdown">
                        <el-dropdown-item>View</el-dropdown-item>
                        <el-dropdown-item>Add</el-dropdown-item>
                        <el-dropdown-item>Delete</el-dropdown-item>
                    </el-dropdown-menu>
                </el-dropdown>
                <span>Tom</span>
            </el-header>

            <el-main>
                <el-table :data="tableData">
                    <el-table-column prop="date" label="Date" width="140">
                    </el-table-column>
                    <el-table-column prop="name" label="Name" width="120">
                    </el-table-column>
                    <el-table-column prop="address" label="Address">
                    </el-table-column>
                </el-table>
            </el-main>
        </el-container>
    </el-container>

</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",
        data() {
            const item = {
                date: '2016-05-02',
                name: 'Tom',
                address: 'No. 189, Grove St, Los Angeles'
            };
            return {
                tableData: Array(20).fill(item)
            }
        }
    })

</script>
</body>
</html>

请添加图片描述
第四,最后一个

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .el-table .warning-row {
            background: oldlace;
        }

        .el-table .success-row {
            background: #f0f9eb;
        }
    </style>


</head>
<body>
<div id="app">

    <!--Search Form-->
    <el-form :inline="true" :model="brand" class="demo-form-inline">
        <el-form-item label="Status Now">
            <el-select v-model="brand.Status" placeholder="Status Now">
                <el-option label="Enable" value="1"></el-option>
                <el-option label="Disable" value="0"></el-option>
            </el-select>
        </el-form-item>

        <el-form-item label="Company">
            <el-input v-model="brand.Company" placeholder="Company"></el-input>
        </el-form-item>

        <el-form-item label="Brand">
            <el-input v-model="brand.Brand" placeholder="Brand"></el-input>
        </el-form-item>
        <el-form-item>
            <el-button type="primary" @click="onSubmit">Query</el-button>
        </el-form-item>
    </el-form>

    <el-row>
        <el-button type="danger" plain>Batch Delete</el-button>
        <el-button type="primary" @click="dialogVisible = true" plain>Add New</el-button>
    </el-row>
    <!--dialog form-->
    <el-dialog
            title="Edit Brand"
            :visible.sync="dialogVisible"
            width="30%"
            >

        <el-form ref="form" :model="brand" label-width="120px">
            <el-form-item label="Brand">
                <el-input v-model="brand.Brand"></el-input>
            </el-form-item>
            <el-form-item label="Company">
                <el-input v-model="brand.Company"></el-input>
            </el-form-item>
            <el-form-item label="Ordered">
                <el-input v-model="brand.Ordered"></el-input>
            </el-form-item>
            <el-form-item label="Remark">
                <el-input type="textarea" v-model="brand.Description"></el-input>
            </el-form-item>
            <el-form-item label="Status">
                <el-switch v-model="brand.Status" active-value="1" inactive-value="0"></el-switch>
            </el-form-item>

            <el-form-item>
                <el-button type="primary" @click="addBrand">Create</el-button>
                <el-button @click="dialogVisible = false">Cancel</el-button>
            </el-form-item>
        </el-form>

<!--        <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible = false">Cancel</el-button>
    <el-button type="primary" @click="dialogVisible = false">Confirm</el-button>-->
  </span>
    </el-dialog>


    <template>
        <el-table
                :data="tableData"
                style="width: 100%"
                :row-class-name="tableRowClassName"
                @selection-change="handleSelectionChange">
            <el-table-column
                    type="selection"
                    align="center"
                    width="55">
            </el-table-column>
            <el-table-column
                    type="index"
                    width="50">
            </el-table-column>
            <el-table-column
                    prop="Brand"
                    label="Brand"
                    align="center"
                    >
            </el-table-column>
            <el-table-column
                    prop="Company"
                    label="Company"
                    align="center"
                    >
            </el-table-column>
            <el-table-column
                    prop="Ordered"
                    label="Ordered"
                    align="center"
                    >
            </el-table-column>
            <el-table-column
                    prop="Status"
                    label="Status"
                    align="center">
            </el-table-column>

            <el-table-column

                    label="Operation"
                    align="center">

                <el-row>
                    <el-button type="primary">Edit</el-button>
                    <el-button type="danger">Delete</el-button>
                </el-row>
            </el-table-column>
        </el-table>
    </template>

    <!--pagination-->
    <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page.sync="currentPage"
            :page-sizes="[100, 200, 300, 400]"
            :page-size="100"
            layout="total, sizes, prev, pager, next, jumper"
            :total="400">
    </el-pagination>

</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",
        methods: {
            tableRowClassName({row, rowIndex}) {
                if (rowIndex === 1) {
                    return 'warning-row';
                } else if (rowIndex === 3) {
                    return 'success-row';
                }
                return '';
            },
            /*multi selection be selected , do this method*/
            handleSelectionChange(val) {
                this.multipleSelection = val;
                /*output the multiple selection see how it is, on browser F12 page*/
                console.log(this.multipleSelection)
            },
            /*for search form, click submit button, see output on browser F12 page */
            onSubmit() {
                console.log(this.brand);
            },

            addBrand(){
                console.log(this.brand)
            },

            /*for pagination*/
            handleSizeChange(val) {
                console.log(`${val} items per page`);
            },
            handleCurrentChange(val) {
                console.log(`current page: ${val}`);
            }

        },
        data() {
            return {
                /*for pagination*/
                currentPage4: 4,

                /*for pop dialog form*/
                dialogVisible: false,

                /*for search form data, and for form in dialog*/
                brand: {
                    Id: '',
                    Brand: '',
                    Company: '',
                    Ordered: '',
                    Description: '',
                    Status: ''
                },

                /*for multi selection box */
                multipleSelection:[],

                tableData:  [{
                    Brand: 'IDEA',
                    Company: 'JetBrain',
                    Ordered: 'No. 189',
                    Status: '1'
                }, {
                    Brand: 'IDEA',
                    Company: 'JetBrain',
                    Ordered: 'No. 189',
                    Status: '1'
                }, {
                    Brand: 'IDEA',
                    Company: 'JetBrain',
                    Ordered: 'No. 189',
                    Status: '1'
                }, {
                    Brand: 'IDEA',
                    Company: 'JetBrain',
                    Ordered: 'No. 189',
                    Status: '1'
                }]

            }
        }

    })

</script>

</body>
</html>

请添加图片描述

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

20220722_使用Element UI写html页面 的相关文章

随机推荐

  • 深度学习语义分割(二)SegNet论文解读

    SegNet是是第一次在语义分割中应用编码器 解码器 encoder decoder 的结构 其中 编码器使用池化层逐渐缩减输入数据的空间维度 而解码器通过反卷积层等网络层逐步恢复目标的细节和相应的空间维度 从编码器到解码器之间 通常存在直
  • 学习使用flex

    会对flex做词法分析了解很多 下面我通过一个例子来详细说明如何使用flex 根据所学的词法分析内容 利用flex构造PL 0语言的词法分析器 既然是构造PL 0的词法分析器 那么我们有必要看一下pl0语言的简介和相应文法 2 PL 0语言
  • Spring Boot集成websocket

    像目前的直播 弹幕 小游戏等方面都用到了websocet进行长链接 相对于http的一次请求一次响应websocket只需要进行一次握手即长久性的建立链接进行消息互通 为什么一些场景要用websocet呢 http的请求每次都会进行校验而请
  • 0000-00-00 00:00:00 的坑,你踩了吗?

    本文内容 1 起因 2 MySQL 对 0000 00 00 的支持 3 Java 对 0000 00 00 的支持 4 为什么线上的代码能正常运行 起因 前几天组内有系统做了数据库迁移 MySQL版本 5 6 16 其中某张表的一个字段是
  • 手机共享网络给电脑解决重装windows7系统没有网卡USB驱动

    手机共享网络给电脑解决重装windows7系统没有网卡USB驱动 我的手机是荣耀手机 使用下面方法 在手机上进入设置 gt 移动网络 gt 个人热点 gt 更多共享设置 开启USB 共享网络开关 共享移动网络或已连接的WLAN 网络给电脑
  • 什么是I帧,P帧,B帧

    视频压缩中 每帧代表一幅静止的图像 而在实际压缩时 会采取各种算法减少数据的容量 其中IPB就是最常见的 简单地说 I帧是关键帧 属于帧内压缩 就是和AVI的压缩是一样的 P是向前搜索的意思 B是双向搜索 他们都是基于I帧来压缩数据 I帧表
  • Redis在数据库事务中的增改操作

    数据库事务中的redis增改模板 if TransactionSynchronizationManager isActualTransactionActive TransactionSynchronizationManager regist
  • EF系列(一)——深入框架底层

    什么是EF 框架 EF 框架是微软的 NET中ORM 对象关系映射 框架 为什么要用EF框架 在没有EF框架之前 我们是直接与ADO Net 进行交互来访问数据库 在SqlHelper 里面面通过设置connection command d
  • SpringMVC+Shiro整合配置文件详解

    在项目中xml文件的配置是必不可少的 特别是SpringMVC框架 但是几乎所有项目的配置都是大同小异 很多人都是直接复制黏贴了事 不少人对其具体含义及用途都不甚全知 本片文章将正对项目中常用的框架SpringMVC Shiro进行整合 并
  • IntelliJ IDEA / Eclipse 自动生成 Author 注释 签名

    Author 注释 签名如下 author 稚枭天卓 E mail zhxiaotianzhuo 163 com version 创建时间 2016 6 20 下午04 58 52 Eclipse 自动生成 Author 注释 签名 win
  • 4位超前进位加法器-Verilog HDL

    Verilog HDL 简介 Verilog HDL是目前设计界通常采用的一种硬件描述语言 被广泛的应用在数字ASIC和可编程逻辑器件的设计开发工作 其按照一定的规则和风格编写代码 可以从系统级 电路级 门级 开关级等抽象层次 进行数字电路
  • jbk和jre的下载与安装

    一 下载 Java可进入Oracle官网下载 点击链接进入官网 1 点击链接进入官网 点击产品 2 打开产品列表 找到java点击 3 下载java 向下滑动选择需要的java版本 以java8为例子 选择Windows版本 选择对应的64
  • 本地真机调试小程序

    1 查出电脑本地ip地址 gt ipconfig 无线局域网适配器 WLAN 连接特定的 DNS 后缀 本地链接 IPv6 地址 xxxxx IPv4 地址 192 168 0 99 子网掩码 255 255 255 0 默认网关 192
  • winxp MySQL 5.6.35 免安装版 简单配置

    Links MySQL 5 6 35 MySQL 5 6 35 32位 下载地址 Reference MySQL 5 6 13免安装版配置方法 Steps 1 解压文件 放到任意一个路径 好像不要有中文 下面 如 D iTom MySQL
  • 09 TypeError: Descriptors cannot not be created directly.

    1 问题 import yaml ModuleNotFoundError No module named yaml yaml模块的pip工具包名称不是yaml 而是pyyaml 所以不是直接pip install yaml 而是 pip i
  • 专治机器学习面试:机器学习各个算法的优缺点!

    今天有朋友聊起来 机器学习算法繁多 各个算法有各个算法的特点 以及在不同场景下 不同算法模型能够发挥各自的优点 今天呢 我把常见的 常用的算法模型进行了一个大概的总结 包括其分支以及各分支的优缺点 涉及到的算法有 回归 正则化算法 集成算法
  • 关于驱动和设备的相关的注册表键的位置,和相关信息

    关于驱动和设备的相关的注册表键的位置 和相关信息 MSDN上有了 https msdn microsoft com en us library windows hardware ff549815 v vs 85 aspx 下面是大概翻译整理
  • kettle-记录集连接(可实现左、右、全、内连接)

    连接前需先排序 记录连接集控件设置 结果 以左连接为例 连接前的两个数据源 连接后
  • 如何让input框中的值不被用户修改

    1 最常用的disabled 被禁用的 input 元素 不可编辑 不可复制 不可选择 不能接收焦点 后台也不会接收到传值 设置后文字的颜色会变成灰色 EP disabled 属性无法与 一起使用 2 readonly unselectab
  • 20220722_使用Element UI写html页面

    Element官网component资源点击这里 结构图 element ui自行下载复制到一致路径 第一个html div div