Skip to content

Commit

Permalink
refactor: simplify bundle files
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Nov 27, 2023
1 parent 96643f1 commit 619b5e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/vue/build/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ async function transformToVueComponent(file: string) {
<template>
${content}
</template>
<script lang="ts">
import type { DefineComponent } from 'vue'
export default ({
name: "${componentName}",
}) as DefineComponent
<script lang="ts" setup>
defineOptions({
name: ${JSON.stringify(componentName)}
})
</script>`,
'vue',
)
Expand Down
3 changes: 3 additions & 0 deletions playground/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<script lang="ts" setup>
import { icons } from '@element-plus/icons-vue/global'
import { Upload } from '@element-plus/icons-vue'
</script>

<template>
<Upload class="icon" />
<hr />
<component :is="Icon" v-for="(Icon, key) in icons" :key="key" class="icon" />
<hr />
<component
Expand Down

0 comments on commit 619b5e7

Please sign in to comment.