提交 81952277 编写于 作者: 郝先瑞

feat(SvgIcon): svg组件setup语法糖优化

上级 4dad286f
......@@ -4,30 +4,25 @@
</svg>
</template>
<script>
import { defineComponent, computed } from 'vue';
<script setup lang="ts">
import { computed } from 'vue';
export default defineComponent({
name: 'SvgIcon',
props: {
prefix: {
type: String,
default: 'icon',
},
iconClass: {
type: String,
required: true,
},
color: {
type: String,
default: ''
},
const props=defineProps({
prefix: {
type: String,
default: 'icon',
},
setup(props) {
const symbolId = computed(() => `#${props.prefix}-${props.iconClass}`);
return { symbolId };
iconClass: {
type: String,
required: true,
},
});
color: {
type: String,
default: ''
}
})
const symbolId = computed(() => `#${props.prefix}-${props.iconClass}`);
</script>
<style scoped>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册