| 123456789101112131415161718192021222324252627282930313233343536373839 |
- <template>
- <view class="l-svg" :style="svgStyle">
- <!-- SVG 占位组件 -->
- </view>
- </template>
- <script setup lang="uts">
- type Props = {
- src?: string
- color?: string
- web?: boolean
- }
- const props = withDefaults(defineProps<Props>(), {
- src: '',
- color: '',
- web: false
- })
- const emit = defineEmits<{
- (e: 'error'): void
- (e: 'load'): void
- }>()
- const svgStyle = computed(() => {
- const style: Map<string, any> = new Map()
- if (props.color.length > 0) {
- style.set('color', props.color)
- }
- return style
- })
- </script>
- <style lang="scss">
- .l-svg {
- display: flex;
- }
- </style>
|