更改动态导航栏
This commit is contained in:
@@ -1,29 +1,50 @@
|
||||
<template>
|
||||
<u-action-sheet :list="list" v-model="show"></u-action-sheet>
|
||||
<view v-for="(item,index) in list" :key="index">
|
||||
<u-button :text="item.text"></u-button>
|
||||
<view>
|
||||
<Nav />
|
||||
<view class="content">页面内容</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
} from 'vue';
|
||||
ref,
|
||||
computed,
|
||||
onMounted
|
||||
} from "vue";
|
||||
import {
|
||||
onLoad,
|
||||
onReady,
|
||||
onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
import Nav from '@/components/indexnav.vue';
|
||||
import {
|
||||
useNavbarStore
|
||||
} from '@/stores/navbarStore';
|
||||
|
||||
const list = ref([{
|
||||
text: 'Southern Wind',
|
||||
},
|
||||
{
|
||||
text: '按钮2'
|
||||
},
|
||||
{
|
||||
text: '按钮2'
|
||||
}
|
||||
]);
|
||||
const show = ref(true);
|
||||
const store = useNavbarStore();
|
||||
// 动态更新导航栏配置
|
||||
store.updateNavbarConfig({
|
||||
showBack: false,
|
||||
rightText: '',
|
||||
showSearch: true,
|
||||
title: '我的页面',
|
||||
isTransparent: false,
|
||||
hasPlaceholder: true
|
||||
});
|
||||
// store.updateNavbarConfig({
|
||||
// showBack: true,//左边返回键
|
||||
// rightText: '',//右边文字
|
||||
// showSearch: true,//true是标题其他事文字
|
||||
// title: '我的页面',
|
||||
// isTransparent: false,
|
||||
// height: 44,
|
||||
// hasPlaceholder: false//是否要占位符
|
||||
// });
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
.content {
|
||||
height: 1000vh;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user