forked from eee555/saolei_website
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request eee555#65 from putianyi889/patch-50
Create IconMenuItem.vue
- Loading branch information
Showing
3 changed files
with
49 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<template> | ||
<el-tooltip v-if="local.menu_icon" :content="props.text"> | ||
<el-icon class="menumargin"> | ||
<slot v-if="props.usehtml" /> | ||
<component v-else :is="props.icon" class="menuicon" /> | ||
</el-icon> | ||
</el-tooltip> | ||
<span v-else style="padding-right: 5px"> | ||
<el-icon> | ||
<slot v-if="props.usehtml" /> | ||
<component v-else :is="props.icon" class="menuicon" /> | ||
</el-icon>{{ props.text }} | ||
</span> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { useLocalStore } from "@/store"; | ||
const local = useLocalStore(); | ||
const props = defineProps({ | ||
text: String, | ||
icon: String, | ||
usehtml: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
}) | ||
</script> | ||
|
||
<style lang="less" scoped> | ||
.menuicon { | ||
width: 60px; | ||
height: 60px; | ||
} | ||
.menumargin { | ||
margin-top: 0px; | ||
margin-bottom: 0px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters