feat(首页): 添加前往示例页的按钮和跳转功能

新增 gotoAbout 方法实现页面跳转功能,并在首页添加对应的按钮
This commit is contained in:
feige996
2025-09-29 20:22:37 +08:00
parent 116921fd72
commit fc04ecc097

View File

@@ -25,6 +25,14 @@ console.log('index/index 首页打印了')
onLoad(() => {
console.log('测试 uni API 自动引入: onLoad')
})
// #region gotoAbout
function gotoAbout() {
uni.navigateTo({
url: '/pages-sub/about/about',
})
}
// #endregion
</script>
<template>
@@ -96,6 +104,11 @@ onLoad(() => {
https://wot-design-uni.cn
</text>
</view>
<view class="mt-4 text-center">
<wd-button type="primary" class="ml-2" @click="gotoAbout">
前往示例页
</wd-button>
</view>
<view class="h-6" />
</view>
</template>