mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-13 16:27:33 +00:00
refactor: icon component
This commit is contained in:
parent
f8cd2849d2
commit
f6b075c11c
@ -24,22 +24,16 @@ limitations under the License. -->
|
|||||||
loading,
|
loading,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<use :href="symbolId"></use>
|
<use :href="`#${iconName}`"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed } from "vue";
|
|
||||||
/*global defineProps */
|
/*global defineProps */
|
||||||
const props = defineProps({
|
defineProps({
|
||||||
iconName: { type: String, default: "" },
|
iconName: { type: String, default: "" },
|
||||||
size: { type: String, default: "sm" },
|
size: { type: String, default: "sm" },
|
||||||
loading: { type: Boolean, default: false },
|
loading: { type: Boolean, default: false },
|
||||||
prefix: {
|
|
||||||
type: String,
|
|
||||||
default: "icon",
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
const symbolId = computed(() => `#${props.prefix}-${props.iconName}`);
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.icon {
|
.icon {
|
||||||
|
@ -48,7 +48,7 @@ export default ({ mode }: ConfigEnv): UserConfig => {
|
|||||||
// Specify the icon folder to be cached
|
// Specify the icon folder to be cached
|
||||||
iconDirs: [path.resolve(__dirname, "./src/assets/icons")],
|
iconDirs: [path.resolve(__dirname, "./src/assets/icons")],
|
||||||
// Specify symbolId format
|
// Specify symbolId format
|
||||||
symbolId: "icon-[dir]-[name]",
|
symbolId: "[name]",
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
|
Loading…
Reference in New Issue
Block a user