feat(vite): 引入 @uni-helper/vite-plugin-uni-layouts

This commit is contained in:
Burt
2023-12-23 11:20:24 +08:00
parent 600274d573
commit da5284331f
7 changed files with 187 additions and 0 deletions

6
src/layouts/default.vue Normal file
View File

@@ -0,0 +1,6 @@
<template>
<view class="default-layout">
<slot />
<view class="mx-auto mt-5 text-center text-sm opacity-25"> [Default Layout] </view>
</view>
</template>

6
src/layouts/home.vue Normal file
View File

@@ -0,0 +1,6 @@
<template>
<view class="home-layout">
<slot />
<view class="mx-auto mt-5 text-center text-sm opacity-25"> [Home Layout] </view>
</view>
</template>

View File

@@ -3,6 +3,7 @@
{
"path": "pages/index/index",
"type": "home",
"layout": "home",
"style": {
"navigationBarTitleText": "我才是标题"
}

View File

@@ -13,6 +13,7 @@
<route lang="json">
{
"layout": "home",
"style": {
"navigationBarTitleText": "我才是标题"
}
@@ -25,6 +26,9 @@ import { useCountStore } from '@/store/count'
const countStore = useCountStore()
const title = ref('Hello')
const uniLayout = ref()
console.log(uniLayout)
</script>
<style>