vue element组件库备忘

2023-07-03  本文已影响0人  ljt001

使用图标(icon)

https://element-plus.org/zh-CN/component/button.html#button-按钮
一种方式是在控制上使用 :icon=<icon名>,比较简洁,见下。
另一种嵌套组件如<el-icon><Search /></el-icon>,较繁琐。

<template>
  <el-row>
    <el-button :icon="Search" circle />
    <el-button type="primary" :icon="Edit" circle />
    <el-button type="success" :icon="Check" circle />
    <el-button type="info" :icon="Message" circle />
    <el-button type="warning" :icon="Star" circle />
    <el-button type="danger" :icon="Delete" circle />
  </el-row>
  <el-row>
    <el-button circle />
        <el-icon><Search /></el-icon>搜索
    </el-button>
  <el-row>
</template>

<script lang="ts" setup>
import {
  Check,
  Delete,
  Edit,
  Message,
  Search,
  Star,
} from '@element-plus/icons-vue'
</script>

el-date-picker值格式

<el-date-picker value-format="YYYY-MM-DD"/>
上一篇下一篇

猜你喜欢

热点阅读