✨(component): 简化 breadcrumb 代码
This commit is contained in:
parent
60aaa9fea2
commit
1c804c6db9
@ -134,4 +134,4 @@ onMounted(() => {
|
||||
onUnmounted(() => {
|
||||
props.target.removeEventListener("scroll", checkInWindow);
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
@ -30,9 +30,8 @@ const classes = computed(() => {
|
||||
});
|
||||
|
||||
const styles = computed<StyleValue>(() => {
|
||||
return [props.color ? `background-color: ${props.color}` : ""]
|
||||
})
|
||||
|
||||
return [props.color ? `background-color: ${props.color}` : ""];
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -8,11 +8,11 @@ export default {
|
||||
import "./index.less";
|
||||
import { provide, withDefaults } from "vue";
|
||||
|
||||
export interface LayBreadcrumbProps {
|
||||
export interface BreadcrumbProps {
|
||||
separator?: string;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<LayBreadcrumbProps>(), {
|
||||
const props = withDefaults(defineProps<BreadcrumbProps>(), {
|
||||
separator: "/",
|
||||
});
|
||||
|
||||
|
@ -12,15 +12,13 @@ export default {
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { inject, useSlots } from "vue";
|
||||
import { inject } from "vue";
|
||||
|
||||
export interface LayBreadcrumbItemProps {
|
||||
export interface BreadcrumbItemProps {
|
||||
title?: string;
|
||||
}
|
||||
|
||||
const slot = useSlots();
|
||||
|
||||
const props = defineProps<LayBreadcrumbItemProps>();
|
||||
const props = defineProps<BreadcrumbItemProps>();
|
||||
|
||||
const separator = inject("separator");
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user