提交 fccd5d19 编写于 作者: D DCloud_LXH

feat: 升级中心使用条件编译到 uni-app-x

上级 59e90591
...@@ -40,7 +40,9 @@ ...@@ -40,7 +40,9 @@
</template> </template>
</uni-collapse> </uni-collapse>
<!-- #ifdef UNI-APP-X -->
<uni-upgrade-center-app ref="upgradePopup" @close="upgradePopupClose" /> <uni-upgrade-center-app ref="upgradePopup" @close="upgradePopupClose" />
<!-- #endif -->
</view> </view>
<!-- #ifdef APP --> <!-- #ifdef APP -->
</scroll-view> </scroll-view>
...@@ -48,7 +50,9 @@ ...@@ -48,7 +50,9 @@
</template> </template>
<script lang="uts"> <script lang="uts">
// #ifdef UNI-APP-X
import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update' import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update'
// #endif
type Page = { type Page = {
name : string name : string
...@@ -284,13 +288,17 @@ export default { ...@@ -284,13 +288,17 @@ export default {
uni.navigateTo({ uni.navigateTo({
url, url,
}) })
}, }
upgradePopupClose() { // #ifdef UNI-APP-X
,upgradePopupClose() {
console.log('upgradePopup close'); console.log('upgradePopup close');
} }
// #endif
}, },
onReady() { onReady() {
// #ifdef UNI-APP-X
checkUpdate(this.$refs['upgradePopup'] as UniUpgradeCenterAppComponentPublicInstance) checkUpdate(this.$refs['upgradePopup'] as UniUpgradeCenterAppComponentPublicInstance)
// #endif
}, },
beforeUnmount() { beforeUnmount() {
uni.showTabBar()?.catch(_ => {}) uni.showTabBar()?.catch(_ => {})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册