feat: 拆分移动游戏项目为独立 z449 子模块(git submodule + i18n prop 桥接)
- mobile-game 模块源码迁出至独立仓库 z449(third_party/z449),独立可渲染/维护 - z449 App.vue 为便携式组件:自带独立 vue-i18n 实例与 locale 文案 - mainPage 侧 MobileGameWrapper 透传 :locale prop,子模块 watch 同步语言 - mainPage i18n 精简:仅保留 tabs.mobileGame,删除 mobileGame.* 大块文案 - 文档:新增 docs/submodule-z449.md,更新 README/architecture/add-module
This commit is contained in:
20
src/modules/mobile-game/MobileGameWrapper.vue
Normal file
20
src/modules/mobile-game/MobileGameWrapper.vue
Normal file
@@ -0,0 +1,20 @@
|
||||
<script setup>
|
||||
// ★ mobile-game 页签的 mainPage 侧包装器。
|
||||
// 子模块 z449 的 App.vue 作为便携式组件被 import,本包装器负责:
|
||||
// 1. 持有 KeepAlive 匹配用的组件名(与模块 id 一致),子模块自身不持 name
|
||||
// 2. 把 mainPage 当前语言经 :locale prop 透传给子模块的独立 i18n 实例,
|
||||
// 使其跟随父项目语言开关响应式切换(不共享 messages,仅同步 locale 值)
|
||||
// 子模块独立运行时不经过本包装器,保持纯净。
|
||||
defineOptions({ name: 'mobile-game' })
|
||||
|
||||
import { computed } from 'vue'
|
||||
import i18n from '../../i18n/index.js'
|
||||
import Z449App from '../../../third_party/z449/src/App.vue'
|
||||
|
||||
// 透传父项目当前语言给子应用(响应式:切语言时子应用内容跟随)
|
||||
const locale = computed(() => i18n.global.locale.value)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Z449App :locale="locale" />
|
||||
</template>
|
||||
Reference in New Issue
Block a user