Skip to content

Commit fb980e7

Browse files
feat: ✨ NavbarCapsule 导航胶囊组件支持外部传入样式
1 parent 4575099 commit fb980e7

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import type { ExtractPropTypes } from 'vue'
2+
import { baseProps } from '../common/props'
3+
4+
export const navbarCapsuleProps = {
5+
...baseProps
6+
}
7+
8+
export type NavbarCapsuleProps = ExtractPropTypes<typeof navbarCapsuleProps>

src/uni_modules/wot-design-uni/components/wd-navbar-capsule/wd-navbar-capsule.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<view class="wd-navbar-capsule">
2+
<view :class="`wd-navbar-capsule ${customClass}`" :style="customStyle">
33
<wd-icon @click="handleBack" name="chevron-left" custom-class="wd-navbar-capsule__icon" />
44
<wd-icon @click="handleBackHome" name="home" custom-class="wd-navbar-capsule__icon" />
55
</view>
@@ -17,7 +17,10 @@ export default {
1717

1818
<script lang="ts" setup>
1919
import wdIcon from '../wd-icon/wd-icon.vue'
20+
import { navbarCapsuleProps } from './types'
21+
2022
const emit = defineEmits(['back', 'back-home'])
23+
defineProps(navbarCapsuleProps)
2124
2225
function handleBack() {
2326
emit('back')

0 commit comments

Comments
 (0)