[组件] 初步集成 breadcrumb 面包屑
This commit is contained in:
@@ -34,6 +34,8 @@ import LayMenuItem from './module/menuItem/index'
|
||||
import LayMenuChildItem from './module/menuChildItem/index'
|
||||
import LayCheckbox from './module/checkbox/index'
|
||||
import LayForm from './module/form/index'
|
||||
import LayBreadcrumb from './module/breadcrumb/index'
|
||||
import LayBreadcrumbItem from './module/breadcrumbItem/index'
|
||||
|
||||
const components: Record<string, IDefineComponent> = {
|
||||
LayRadio,
|
||||
@@ -66,7 +68,9 @@ const components: Record<string, IDefineComponent> = {
|
||||
LayMenuItem,
|
||||
LayMenuChildItem,
|
||||
LayCheckbox,
|
||||
LayForm
|
||||
LayForm,
|
||||
LayBreadcrumb,
|
||||
LayBreadcrumbItem
|
||||
}
|
||||
|
||||
const install = (app: App, options?: InstallOptions): void => {
|
||||
@@ -111,6 +115,8 @@ export {
|
||||
LayMenuChildItem,
|
||||
LayCheckbox,
|
||||
LayForm,
|
||||
LayBreadcrumb,
|
||||
LayBreadcrumbItem,
|
||||
install,
|
||||
}
|
||||
|
||||
|
||||
@@ -6,4 +6,4 @@ Component.install = (app: App) => {
|
||||
app.component(Component.name || 'LayBody', Component)
|
||||
}
|
||||
|
||||
export default Component as IDefineComponent
|
||||
export default Component as IDefineComponent
|
||||
9
src/module/breadcrumb/index.ts
Normal file
9
src/module/breadcrumb/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { App } from 'vue'
|
||||
import Component from './index.vue'
|
||||
import type { IDefineComponent } from '../type/index'
|
||||
|
||||
Component.install = (app: App) => {
|
||||
app.component(Component.name || 'LayBreadcrumb', Component)
|
||||
}
|
||||
|
||||
export default Component as IDefineComponent
|
||||
10
src/module/breadcrumb/index.vue
Normal file
10
src/module/breadcrumb/index.vue
Normal file
@@ -0,0 +1,10 @@
|
||||
<template>
|
||||
<span class="layui-breadcrumb" style="visibility: visible;">
|
||||
<slot></slot>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script setup name="LayBreadcrumb" lang="ts">
|
||||
import { useSlots } from "vue";
|
||||
|
||||
</script>
|
||||
9
src/module/breadcrumbItem/index.ts
Normal file
9
src/module/breadcrumbItem/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { App } from 'vue'
|
||||
import Component from './index.vue'
|
||||
import type { IDefineComponent } from '../type/index'
|
||||
|
||||
Component.install = (app: App) => {
|
||||
app.component(Component.name || 'LayBreadcrumbItem', Component)
|
||||
}
|
||||
|
||||
export default Component as IDefineComponent
|
||||
15
src/module/breadcrumbItem/index.vue
Normal file
15
src/module/breadcrumbItem/index.vue
Normal file
@@ -0,0 +1,15 @@
|
||||
<template>
|
||||
<a href="">{{title}}</a>
|
||||
<span lay-separator="">/</span>
|
||||
</template>
|
||||
|
||||
<script setup name="LayBreadcrumbItem" lang="ts">
|
||||
import { defineProps } from 'vue'
|
||||
|
||||
const props =
|
||||
defineProps<{
|
||||
title: string
|
||||
}>()
|
||||
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user