mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-12-15 14:50:29 +08:00
perf: 将本地图标全部按需引入,首屏加载减少 61 个图标资源,首屏加载再次变快 (#389)
* perf: 优化图标,将本地图标按需引入,首屏加载减少 `61` 个图标资源,首屏加载再次变快
This commit is contained in:
@@ -8,6 +8,15 @@ import { TableProBar } from "@/components/ReTable";
|
||||
import { type PaginationProps } from "@pureadmin/table";
|
||||
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
||||
|
||||
import Role from "@iconify-icons/ri/admin-line";
|
||||
import Password from "@iconify-icons/ri/lock-password-line";
|
||||
import More from "@iconify-icons/ep/more-filled";
|
||||
import Delete from "@iconify-icons/ep/delete";
|
||||
import EditPen from "@iconify-icons/ep/edit-pen";
|
||||
import Search from "@iconify-icons/ep/search";
|
||||
import Refresh from "@iconify-icons/ep/refresh";
|
||||
import AddFill from "@iconify-icons/ri/add-circle-line";
|
||||
|
||||
defineOptions({
|
||||
name: "User"
|
||||
});
|
||||
@@ -104,16 +113,13 @@ onMounted(() => {
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
:icon="useRenderIcon('search')"
|
||||
:icon="useRenderIcon(Search)"
|
||||
:loading="loading"
|
||||
@click="onSearch"
|
||||
>
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button
|
||||
:icon="useRenderIcon('refresh')"
|
||||
@click="resetForm(formRef)"
|
||||
>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)">
|
||||
重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
@@ -126,7 +132,7 @@ onMounted(() => {
|
||||
@refresh="onSearch"
|
||||
>
|
||||
<template #buttons>
|
||||
<el-button type="primary" :icon="useRenderIcon('add')">
|
||||
<el-button type="primary" :icon="useRenderIcon(AddFill)">
|
||||
新增用户
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -156,7 +162,7 @@ onMounted(() => {
|
||||
type="primary"
|
||||
:size="size"
|
||||
@click="handleUpdate(row)"
|
||||
:icon="useRenderIcon('edits')"
|
||||
:icon="useRenderIcon(EditPen)"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
@@ -167,7 +173,7 @@ onMounted(() => {
|
||||
link
|
||||
type="primary"
|
||||
:size="size"
|
||||
:icon="useRenderIcon('delete')"
|
||||
:icon="useRenderIcon(Delete)"
|
||||
@click="handleDelete(row)"
|
||||
>
|
||||
删除
|
||||
@@ -181,7 +187,7 @@ onMounted(() => {
|
||||
type="primary"
|
||||
:size="size"
|
||||
@click="handleUpdate(row)"
|
||||
:icon="useRenderIcon('more')"
|
||||
:icon="useRenderIcon(More)"
|
||||
/>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
@@ -191,7 +197,7 @@ onMounted(() => {
|
||||
link
|
||||
type="primary"
|
||||
:size="size"
|
||||
:icon="useRenderIcon('password')"
|
||||
:icon="useRenderIcon(Password)"
|
||||
>
|
||||
重置密码
|
||||
</el-button>
|
||||
@@ -202,7 +208,7 @@ onMounted(() => {
|
||||
link
|
||||
type="primary"
|
||||
:size="size"
|
||||
:icon="useRenderIcon('role')"
|
||||
:icon="useRenderIcon(Role)"
|
||||
>
|
||||
分配角色
|
||||
</el-button>
|
||||
|
||||
@@ -5,6 +5,15 @@ import { getDeptList } from "@/api/system";
|
||||
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
||||
import { ref, watch, onMounted, getCurrentInstance } from "vue";
|
||||
|
||||
import LocationCompany from "@iconify-icons/ep/add-location";
|
||||
import UnExpand from "@iconify-icons/mdi/arrow-expand-right";
|
||||
import Expand from "@iconify-icons/mdi/arrow-expand-down";
|
||||
import More2Fill from "@iconify-icons/ri/more-2-fill";
|
||||
import Reset from "@iconify-icons/ri/restart-line";
|
||||
import Dept from "@iconify-icons/ri/git-branch-line";
|
||||
import OfficeBuilding from "@iconify-icons/ep/office-building";
|
||||
import Search from "@iconify-icons/ep/search";
|
||||
|
||||
interface Tree {
|
||||
id: number;
|
||||
name: string;
|
||||
@@ -85,7 +94,7 @@ onMounted(async () => {
|
||||
<el-icon class="el-input__icon">
|
||||
<IconifyIconOffline
|
||||
v-show="searchValue.length === 0"
|
||||
icon="search"
|
||||
:icon="Search"
|
||||
/>
|
||||
</el-icon>
|
||||
</template>
|
||||
@@ -94,7 +103,7 @@ onMounted(async () => {
|
||||
<IconifyIconOffline
|
||||
class="w-[28px] cursor-pointer"
|
||||
width="18px"
|
||||
icon="more-vertical"
|
||||
:icon="More2Fill"
|
||||
/>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
@@ -103,7 +112,7 @@ onMounted(async () => {
|
||||
class="reset-margin !h-[20px] !text-gray-500 dark:!text-white dark:hover:!text-primary"
|
||||
link
|
||||
type="primary"
|
||||
:icon="useRenderIcon('expand')"
|
||||
:icon="useRenderIcon(Expand)"
|
||||
@click="toggleRowExpansionAll(true)"
|
||||
>
|
||||
展开全部
|
||||
@@ -114,7 +123,7 @@ onMounted(async () => {
|
||||
class="reset-margin !h-[20px] !text-gray-500 dark:!text-white dark:hover:!text-primary"
|
||||
link
|
||||
type="primary"
|
||||
:icon="useRenderIcon('unExpand')"
|
||||
:icon="useRenderIcon(UnExpand)"
|
||||
@click="toggleRowExpansionAll(false)"
|
||||
>
|
||||
折叠全部
|
||||
@@ -125,7 +134,7 @@ onMounted(async () => {
|
||||
class="reset-margin !h-[20px] !text-gray-500 dark:!text-white dark:hover:!text-primary"
|
||||
link
|
||||
type="primary"
|
||||
:icon="useRenderIcon('reset')"
|
||||
:icon="useRenderIcon(Reset)"
|
||||
@click="onReset"
|
||||
>
|
||||
重置状态
|
||||
@@ -170,10 +179,10 @@ onMounted(async () => {
|
||||
<IconifyIconOffline
|
||||
:icon="
|
||||
data.type === 1
|
||||
? 'office-building'
|
||||
? OfficeBuilding
|
||||
: data.type === 2
|
||||
? 'location-company'
|
||||
: 'dept'
|
||||
? LocationCompany
|
||||
: Dept
|
||||
"
|
||||
/>
|
||||
{{ node.label }}
|
||||
|
||||
Reference in New Issue
Block a user