parent
0832194e61
commit
e4b7a76912
@ -0,0 +1,3 @@
|
||||
import Infotip from './src/Infotip.vue'
|
||||
|
||||
export { Infotip }
|
||||
@ -0,0 +1,52 @@
|
||||
<script setup lang="ts">
|
||||
import { PropType } from 'vue'
|
||||
import { Highlight } from '@//components/Highlight'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
|
||||
const { getPrefixCls } = useDesign()
|
||||
|
||||
const prefixCls = getPrefixCls('infotip')
|
||||
|
||||
defineProps({
|
||||
title: propTypes.string.def(''),
|
||||
schema: {
|
||||
type: Array as PropType<Array<string | TipSchema>>,
|
||||
required: true,
|
||||
default: () => []
|
||||
},
|
||||
showIndex: propTypes.bool.def(true),
|
||||
highlightColor: propTypes.string.def('var(--el-color-primary)')
|
||||
})
|
||||
|
||||
const emit = defineEmits(['click'])
|
||||
|
||||
const keyClick = (key: string) => {
|
||||
emit('click', key)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
:class="[
|
||||
prefixCls,
|
||||
'p-20px mb-20px border-1px border-solid border-[var(--el-color-primary)] bg-[var(--el-color-primary-light-9)]'
|
||||
]"
|
||||
>
|
||||
<div v-if="title" :class="[`${prefixCls}__header`, 'flex items-center']">
|
||||
<Icon icon="bi:exclamation-circle-fill" :size="22" color="var(--el-color-primary)" />
|
||||
<span :class="[`${prefixCls}__title`, 'pl-5px text-14px font-bold']">{{ title }}</span>
|
||||
</div>
|
||||
<div :class="`${prefixCls}__content`">
|
||||
<p v-for="(item, $index) in schema" :key="$index" class="pl-8px text-14px mt-15px">
|
||||
<Highlight
|
||||
:keys="typeof item === 'string' ? [] : item.keys"
|
||||
:color="highlightColor"
|
||||
@click="keyClick"
|
||||
>
|
||||
{{ showIndex ? `${$index + 1}、` : '' }}{{ typeof item === 'string' ? item : item.label }}
|
||||
</Highlight>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -0,0 +1,47 @@
|
||||
<script setup lang="ts">
|
||||
import { ContentWrap } from '@/components/ContentWrap'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { Infotip } from '@/components/Infotip'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const keyClick = (key: string) => {
|
||||
if (key === t('iconDemo.accessAddress')) {
|
||||
window.open('https://iconify.design/')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Infotip
|
||||
:show-index="false"
|
||||
:title="`${t('iconDemo.recommendedUse')}${t('iconDemo.iconify')}`"
|
||||
:schema="[
|
||||
{
|
||||
label: t('iconDemo.recommendeDes'),
|
||||
keys: ['Iconify']
|
||||
},
|
||||
{
|
||||
label: t('iconDemo.accessAddress'),
|
||||
keys: [t('iconDemo.accessAddress')]
|
||||
}
|
||||
]"
|
||||
@click="keyClick"
|
||||
/>
|
||||
<ContentWrap :title="t('iconDemo.localIcon')">
|
||||
<div class="flex justify-between">
|
||||
<Icon icon="svg-icon:peoples" />
|
||||
<Icon icon="svg-icon:money" />
|
||||
<Icon icon="svg-icon:message" />
|
||||
<Icon icon="svg-icon:shopping" />
|
||||
</div>
|
||||
</ContentWrap>
|
||||
<ContentWrap :title="t('iconDemo.iconify')">
|
||||
<div class="flex justify-between">
|
||||
<Icon icon="ep:aim" />
|
||||
<Icon icon="ep:alarm-clock" />
|
||||
<Icon icon="ep:baseball" />
|
||||
<Icon icon="ep:chat-line-round" />
|
||||
</div>
|
||||
</ContentWrap>
|
||||
</template>
|
||||
@ -0,0 +1,4 @@
|
||||
declare interface TipSchema {
|
||||
label: string
|
||||
keys?: string[]
|
||||
}
|
||||
Loading…
Reference in New Issue