/** * @description vue version svg icon ( unstable! ) * @author 阿怪 * @date 2024/1/6 02:40 * @version v1.0.0 * * 江湖的业务千篇一律,复杂的代码好几百行。 */ import { defineComponent } from 'vue'; import { LI_ICON_ID } from './MSvgSymbol'; import useSvgInject from '../../../compositions/common/useSvgInject.ts'; export default defineComponent((props: { width?: number | string, height?: number | string, wrapperWidth?: number | string, wrapperHeight?: number | string, innerWidth?: number | string, innerHeight?: number | string, class?: string, wrapper?: boolean, inner?: boolean, }) => { const { svgUrl, installIconSvg, isAuto } = useSvgInject(LI_ICON_ID); if (isAuto.value) { installIconSvg(); } return () => (
{props.wrapper ? ( ) : null} {props.inner ? ( ) : null}
); }, { name: 'MSvgIcon', props: { width: { type: [Number, String], default: '27px' }, height: { type: [Number, String], default: '27px' }, wrapperWidth: { type: [Number, String], default: '22px' }, wrapperHeight: { type: [Number, String], default: '22px' }, innerWidth: { type: [Number, String], default: '10px' }, innerHeight: { type: [Number, String], default: '13px' }, class: { type: String, default: '' }, wrapper: { type: Boolean, default: false }, inner: { type: Boolean, default: true }, }, });