feat(breadcrumb): 修复面包屑组件

This commit is contained in:
就眠仪式
2021-10-15 10:46:34 +08:00
parent 40114bee0d
commit cb5c7e0cfc
4 changed files with 34 additions and 12 deletions

View File

@@ -5,7 +5,7 @@
</template>
<script setup name="LayBreadcrumb" lang="ts">
import { defineProps, provide, withDefaults, useSlots, ref, Ref } from 'vue'
import { defineProps, provide, withDefaults } from 'vue'
const props = withDefaults(
defineProps<{

View File

@@ -1,14 +1,24 @@
<template>
<a href>{{ title }}</a>
<a href="javascript:void(0);">
<template v-if="slot.default">
<slot></slot>
</template>
<template v-else>
{{ title }}
</template>
</a>
<span lay-separator>{{ separator }}</span>
</template>
<script setup name="LayBreadcrumbItem" lang="ts">
import { defineProps, inject } from 'vue'
import { defineProps, inject, useSlots } from 'vue'
const props = defineProps<{
title: string
}>()
const slot = useSlots()
const props =
defineProps<{
title: string
}>()
const separator = inject('separator')
</script>