feat(breadcrumb): [breadcrumb] adapts to xdesign theme (#1693)

This commit is contained in:
wuyiping0628 2024-06-25 20:34:11 -07:00 committed by GitHub
parent 66f4d2153d
commit afe9682f8a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 12 additions and 3 deletions

View File

@ -11,6 +11,7 @@ import Pager from './src/pager'
import Select from './src/select'
import TreeNode from './src/tree-node'
import UploadList from './src/upload-list'
import BreadcrumbItem from './src/breadcrumb-item'
import { version } from './package.json'
export default {
@ -29,6 +30,7 @@ export default {
Pager,
Select,
TreeNode,
BreadcrumbItem,
UploadList
}
}

View File

@ -0,0 +1,3 @@
export default {
separator: '/'
}

View File

@ -23,13 +23,17 @@ export const api = ['linkClick', 'state']
export const renderless = (
props: IBreadcrumbItemProps,
{ reactive, inject }: ISharedRenderlessParamHooks,
{ designConfig },
{ refs, router, emit }: IBreadcrumbItemRenderlessParamUtils
) => {
const breadcrumbEmitter = inject('breadcrumbEmitter')
const breadcrumb = inject('breadcrumb')
const constants = breadcrumb._constants
// separator
const separator = props.separator || designConfig?.separator || '>'
const state = reactive({
size: inject('size', null)
size: inject('size', null),
separator
})
const api: IBreadcrumbItemApi = {
state,

View File

@ -21,7 +21,7 @@
:is="breadcrumb.separatorIcon"
class="tiny-svg-size tiny-breadcrumb__separator-cls"
/>
<span v-else class="tiny-breadcrumb__separator">{{ breadcrumb.separator }}</span>
<span v-else class="tiny-breadcrumb__separator">{{ state.separator }}</span>
</span>
</template>

View File

@ -26,7 +26,7 @@ export const breadcrumbProps = {
},
separator: {
type: String,
default: '>'
default: ''
},
separatorIcon: {
type: Object