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>
|
<script lang="ts" setup>
|
||||||
withDefaults(defineProps<{
|
withDefaults(
|
||||||
leftText?: string;
|
defineProps<{
|
||||||
rightText?: string;
|
leftText?: string
|
||||||
leftArrow?: boolean;
|
rightText?: string
|
||||||
bordered?: boolean;
|
leftArrow?: boolean
|
||||||
fixed?: boolean;
|
bordered?: boolean
|
||||||
placeholder?: boolean;
|
fixed?: boolean
|
||||||
zIndex?: number;
|
placeholder?: boolean
|
||||||
safeAreaInsetTop?: boolean;
|
zIndex?: number
|
||||||
leftDisabled?: boolean;
|
safeAreaInsetTop?: boolean
|
||||||
rightDisabled?: boolean;
|
leftDisabled?: boolean
|
||||||
}>(), {
|
rightDisabled?: boolean
|
||||||
|
}>(),
|
||||||
|
{
|
||||||
leftText: '返回',
|
leftText: '返回',
|
||||||
rightText: '',
|
rightText: '',
|
||||||
leftArrow: true,
|
leftArrow: true,
|
||||||
@ -21,24 +23,32 @@ withDefaults(defineProps<{
|
|||||||
safeAreaInsetTop: true,
|
safeAreaInsetTop: true,
|
||||||
leftDisabled: false,
|
leftDisabled: false,
|
||||||
rightDisabled: false,
|
rightDisabled: false,
|
||||||
});
|
},
|
||||||
|
)
|
||||||
|
|
||||||
function handleClickLeft() {
|
function handleClickLeft() {
|
||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
fail() {
|
fail() {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/index/index',
|
url: '/pages/index/index',
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<wd-navbar
|
<wd-navbar
|
||||||
:left-text="leftText" :right-text="rightText" :left-arrow="leftArrow"
|
:left-text="leftText"
|
||||||
:bordered="bordered" :fixed="fixed" :placeholder="placeholder" :z-index="zIndex"
|
:right-text="rightText"
|
||||||
:safe-area-inset-top="safeAreaInsetTop" :left-disabled="leftDisabled" :right-disabled="rightDisabled"
|
: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"
|
@click-left="handleClickLeft"
|
||||||
>
|
>
|
||||||
<template #title>
|
<template #title>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user