feat: 添加@uni-ku/root依赖并配置vite插件

移除页面中的tabbar布局配置
在default.vue中暴露testUniLayoutExposedData
添加App.ku.vue作为根组件
更新pages.json移除tabbar布局配置
This commit is contained in:
feige996
2025-08-24 21:42:04 +08:00
parent 21cbb7970b
commit a108236784
9 changed files with 57 additions and 6 deletions

View File

@@ -1,6 +1,5 @@
<route lang="jsonc" type="page">
{
"layout": "tabbar",
"style": {
"navigationBarTitleText": "关于"
}
@@ -49,6 +48,11 @@ onReady(() => {
console.log('onReady:', uniLayout.value) // onReady: Proxy(Object)
console.log('onReady:', uniLayout.value.testUniLayoutExposedData) // onReady: testUniLayoutExposedData
})
// 结论第一次通过onShow获取不到但是可以通过 onReady获取到后面就可以通过onShow获取到了
onShow(() => {
console.log('onShow:', uniLayout.value) // onReady: Proxy(Object)
console.log('onShow:', uniLayout.value?.testUniLayoutExposedData) // onReady: testUniLayoutExposedData
})
function gotoTabbar() {
uni.switchTab({

View File

@@ -1,7 +1,6 @@
<!-- 使用 type="home" 属性设置首页其他页面不需要设置默认为page -->
<route lang="jsonc" type="home">
{
"layout": "tabbar",
"style": {
// 'custom' 表示开启自定义导航栏,默认 'default'
"navigationStyle": "custom",

View File

@@ -1,6 +1,5 @@
<route lang="jsonc" type="page">
{
"layout": "tabbar",
"style": {
// 'custom' 表示开启自定义导航栏,默认 'default'
// "navigationStyle": "custom",