feat: 添加@uni-ku/root依赖并配置vite插件
移除页面中的tabbar布局配置 在default.vue中暴露testUniLayoutExposedData 添加App.ku.vue作为根组件 更新pages.json移除tabbar布局配置
This commit is contained in:
@@ -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({
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<!-- 使用 type="home" 属性设置首页,其他页面不需要设置,默认为page -->
|
||||
<route lang="jsonc" type="home">
|
||||
{
|
||||
"layout": "tabbar",
|
||||
"style": {
|
||||
// 'custom' 表示开启自定义导航栏,默认 'default'
|
||||
"navigationStyle": "custom",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<route lang="jsonc" type="page">
|
||||
{
|
||||
"layout": "tabbar",
|
||||
"style": {
|
||||
// 'custom' 表示开启自定义导航栏,默认 'default'
|
||||
// "navigationStyle": "custom",
|
||||
|
||||
Reference in New Issue
Block a user