页面跳转

This commit is contained in:
shikong 2024-10-16 16:35:36 +08:00
parent 2dd03a27bf
commit a06a017aa3
Signed by: Shikong
GPG Key ID: BD85FF18B373C341
3 changed files with 37 additions and 15 deletions

View File

@ -8,10 +8,15 @@
}, },
{ {
"path": "pages/my-info/my-info", "path": "pages/my-info/my-info",
"style" : "style": {
{
"navigationBarTitleText": "我的" "navigationBarTitleText": "我的"
} }
},
{
"path": "pages/test-page/test-page",
"style": {
"navigationBarTitleText": "测试页面"
}
} }
], ],
"globalStyle": { "globalStyle": {

View File

@ -2,18 +2,16 @@
<view> <view>
页面内容 页面内容
</view> </view>
<button @click="toTestPage">进入测试页面</button>
</template> </template>
<script> <script setup>
export default { function toTestPage(){
data() { uni.navigateTo({
return { url: '/pages/test-page/test-page',
animationDuration: 100
} })
},
methods: {
}
} }
</script> </script>

View File

@ -0,0 +1,19 @@
<template>
<view>
测试
</view>
<button @tap="back">返回上一页</button>
</template>
<script setup>
function back() {
uni.navigateBack({
animationDuration: 100
})
}
</script>
<style scoped lang="scss">
</style>