docs: 更新 page-container 组件文档,重命名导航栏属性,添加样式变量说明及示例,优化返回按钮逻辑

This commit is contained in:
熊熊熊子路
2026-03-19 14:07:25 +08:00
parent caf5803e44
commit 58cd96aaa3
3 changed files with 104 additions and 73 deletions
@@ -123,6 +123,7 @@ Component({
* 返回按钮点击事件
*/
goBack() {
console.warn('点击了箭头按钮')
wx.navigateBack({
success: (res) => {
// 转发成功事件
@@ -138,26 +139,5 @@ Component({
},
})
},
/**
* 处理返回成功事件(从 t-navbar 转发)
*/
handleBackSuccess(e: WechatMiniprogram.CustomEvent) {
this.triggerEvent('success', e.detail)
},
/**
* 处理返回失败事件(从 t-navbar 转发)
*/
handleBackFail(e: WechatMiniprogram.CustomEvent) {
this.triggerEvent('fail', e.detail)
},
/**
* 处理返回完成事件(从 t-navbar 转发)
*/
handleBackComplete(e: WechatMiniprogram.CustomEvent) {
this.triggerEvent('complete', e.detail)
},
},
})
@@ -15,9 +15,6 @@
title-max-length="{{navBarTitleMaxLength}}"
visible="{{navBarVisible}}"
bind:go-back="goBack"
bind:success="handleBackSuccess"
bind:fail="handleBackFail"
bind:complete="handleBackComplete"
style="--td-navbar-color: {{navBarTextColor}};--td-navbar-bg-color: {{navBarBackgroundColor}};"
>
<!-- 左侧自定义内容插槽 -->