代码拉取完成,页面将自动刷新
<template>
<view class="u-page">
<!-- 2.0.19支持autoBack,默认为false -->
<up-navbar
title="导航栏"
safeAreaInsetTop
fixed
placeholder
:autoBack="true"
>
</up-navbar>
<view class="u-page__item">
<text class="u-page__item__title">基础功能</text>
<up-navbar
title="个人中心"
:safeAreaInsetTop="false"
:fixed="false"
@rightClick="rightClick"
@leftClick="leftClick"
>
</up-navbar>
</view>
<view class="u-page__item">
<text class="u-page__item__title">自定义文本</text>
<up-navbar
:safeAreaInsetTop="false"
title="个人中心"
:fixed="false"
left-text="返回"
rightIcon="map"
>
</up-navbar>
</view>
<view class="u-page__item">
<text class="u-page__item__title">自定义插槽</text>
<up-navbar
leftText="返回"
:fixed="false"
title="个人中心"
:safeAreaInsetTop="false"
>
<template #left>
<view
class="u-nav-slot"
>
<up-icon
name="arrow-left"
size="19"
></up-icon>
<up-line
direction="column"
:hairline="false"
length="16"
margin="0 8px"
></up-line>
<up-icon
name="home"
size="20"
></up-icon>
</view>
</template>
</up-navbar>
</view>
<up-gap height="50"></up-gap>
</view>
</template>
<script setup>
// 导入必要的函数
import { getCurrentInstance } from 'vue'
// 使用 getCurrentInstance 获取当前实例
const instance = getCurrentInstance()
// 定义方法
const navigateBack = () => {
uni.navigateBack({
delta: 1
})
}
const rightClick = () => {
console.log('rightClick');
}
const leftClick = () => {
console.log('leftClick');
}
</script>
<style lang="scss">
/* #ifndef APP-NVUE */
page {
background-color: $u-bg-color;
}
/* #endif */
.u-page {
padding: 0;
flex: 1;
background-color: $u-bg-color;
&__item {
&__title {
color: $u-tips-color;
background-color: $u-bg-color;
padding: 15px;
font-size: 15px;
&__slot-title {
color: $u-primary;
font-size: 14px;
}
}
}
}
.u-nav-slot {
@include flex;
align-items: center;
justify-content: space-between;
border-width: 0.5px;
border-radius: 100px;
border-color: $u-border-color;
padding: 3px 7px;
opacity: 0.8;
}
</style>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。