Feat web title bar#2530
Open
mackwang112 wants to merge 4 commits into
Open
Conversation
hiyuki
reviewed
Jul 1, 2026
| if (ctorType === 'page') { | ||
| if (isWeb(mode)) { | ||
| return createASTElement('page') | ||
| const rootView = createASTElement('titlebar', [ |
Collaborator
There was a problem hiding this comment.
不应再这个位置处理注入,且不应该修改page标签,会破坏page选择器表现
Collaborator
Author
There was a problem hiding this comment.
以修改到processTemplate 中按页面插入,保留page标签
- 移除 compiler.js 中 page+web 模式下插入 titlebar AST 节点的逻辑,还原为 createASTElement('page')
- 删除 platform/template/wx/component-config/titlebar.js 及其注册
- 移除 dom-tag-config.js 中 mpx-titlebar 的 isBuildInWebTag 注册
- processTemplate.js 中对 page 类型按编译期 navigationStyle 判断插入 mpx-titlebar,注册为 builtInComponent 而非全局组件
- processJSON.js 处理 app 时写入 mpx.appJson 供编译期复用
- mpx-titlebar.vue:简化 props(移除 windowConfig,pageConfig 接收已合并配置)、移除冗余 cfg computed、navigator.userAgent 移至 computed 避免 SSR 崩溃、删除 console.log
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
新方案不对外暴露 titlebar 标签供用户调用,不需要在 isNativeMiniTag 中注册 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
支持web下的titlebar,模拟微信原生titlebar效果,适用于不存在地址栏的webview容器中使用,需在运行时通过设置
mpx.config.webConfig.enableTitleBar = true开启改效果采用内建组件实现方式,新增mpx-titlebar组件作为所有页面根容器