本地引入elementUI图标使用

1、到Element - The world's most popular Vue UI framework中找到CDN

2、找到CDN里script中的代码,复制路径href双引号的部分

https://unpkg.com/element-ui@2.15.9/lib/theme-chalk/index.css

https://unpkg.com/element-ui@2.15.9/lib/index.js

 3、打开之后,界面如下,按住Ctrl+S下载到自己保存的文件夹中

 4、在项目中引入,注意还得自己引入一个vue.js文件

 需要注意的是:以下两个文件可以不在文件中引入,但是一定需要放在此文件夹下,因为请求路径里有一个fonts文件夹

 

 5、在容器中使用

<div id="app">
        <i class="el-icon-edit"></i>
        <i class="el-icon-share"></i>
        <i class="el-icon-delete"></i>
        <i class="el-icon-arrow-left"></i>
        <i class="el-icon-male" style="font-size: 100px;"></i>
        <el-button type="primary" icon="el-icon-search">搜索</el-button>

        <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 style="margin-top: 15px;">
            <el-input placeholder="请输入内容" v-model="input3" class="input-with-select">
                <el-button slot="append" icon="el-icon-search" @click="btn_click"></el-button>
            </el-input>
        </div>
    </div>
    <script>
        new Vue({
            el: '#app',
            data() {
                return {
                    input3: '',
                }
            },
            methods: {
                btn_click() {
                    if(this.input3 == "") {
                        alert("请输入内容!")
                    }else {
                        console.log(this.input3);
                    }
                }
            }
        })
    </script>

6、文件下载

https://unpkg.com/browse/element-ui@2.5.4/lib/theme-chalk/fonts/

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值