style(fg-navbar): 格式化组件代码以提高可读性
重构 fg-navbar.vue 文件的代码格式,主要修改包括: 1. 将 withDefaults 和 defineProps 的代码结构重新排版 2. 统一使用 2 空格缩进 3. 将模板中的属性分行排列 这些改动不影响组件功能,仅提升代码可读性和维护性
This commit is contained in:
parent
3bea809f19
commit
34a6b4b229
@ -1,16 +1,18 @@
|
||||
<script lang="ts" setup>
|
||||
withDefaults(defineProps<{
|
||||
leftText?: string;
|
||||
rightText?: string;
|
||||
leftArrow?: boolean;
|
||||
bordered?: boolean;
|
||||
fixed?: boolean;
|
||||
placeholder?: boolean;
|
||||
zIndex?: number;
|
||||
safeAreaInsetTop?: boolean;
|
||||
leftDisabled?: boolean;
|
||||
rightDisabled?: boolean;
|
||||
}>(), {
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
leftText?: string
|
||||
rightText?: string
|
||||
leftArrow?: boolean
|
||||
bordered?: boolean
|
||||
fixed?: boolean
|
||||
placeholder?: boolean
|
||||
zIndex?: number
|
||||
safeAreaInsetTop?: boolean
|
||||
leftDisabled?: boolean
|
||||
rightDisabled?: boolean
|
||||
}>(),
|
||||
{
|
||||
leftText: '返回',
|
||||
rightText: '',
|
||||
leftArrow: true,
|
||||
@ -21,24 +23,32 @@ withDefaults(defineProps<{
|
||||
safeAreaInsetTop: true,
|
||||
leftDisabled: false,
|
||||
rightDisabled: false,
|
||||
});
|
||||
},
|
||||
)
|
||||
|
||||
function handleClickLeft() {
|
||||
uni.navigateBack({
|
||||
fail() {
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index',
|
||||
});
|
||||
})
|
||||
},
|
||||
});
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<wd-navbar
|
||||
:left-text="leftText" :right-text="rightText" :left-arrow="leftArrow"
|
||||
:bordered="bordered" :fixed="fixed" :placeholder="placeholder" :z-index="zIndex"
|
||||
:safe-area-inset-top="safeAreaInsetTop" :left-disabled="leftDisabled" :right-disabled="rightDisabled"
|
||||
:left-text="leftText"
|
||||
:right-text="rightText"
|
||||
:left-arrow="leftArrow"
|
||||
:bordered="bordered"
|
||||
:fixed="fixed"
|
||||
:placeholder="placeholder"
|
||||
:z-index="zIndex"
|
||||
:safe-area-inset-top="safeAreaInsetTop"
|
||||
:left-disabled="leftDisabled"
|
||||
:right-disabled="rightDisabled"
|
||||
@click-left="handleClickLeft"
|
||||
>
|
||||
<template #title>
|
||||
|
Loading…
x
Reference in New Issue
Block a user