automated_uniapp/uni_modules/cool-app/pages/version/demo.vue
2025-01-09 16:16:11 +08:00

39 lines
815 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<cl-page>
<view class="page">
<cl-text block :margin="[0, 0, 20, 0]">当前版本{{ version?.num }}</cl-text>
<cl-text block color="success"
>最新版本{{ version.updateInfo?.version || "-" }}</cl-text
>
<cl-button :margin="[20, 0, 0, 0]" @tap="check">点击测试</cl-button>
<!-- 版本升级组件 -->
<cl-version-upgrade :ref="setRefs('versionUpgrade')" />
</view>
</cl-page>
</template>
<script lang="ts" setup>
import { onReady } from "@dcloudio/uni-app";
import { useCool } from "/@/cool";
import { useVersion } from "../../hooks";
const { refs, setRefs } = useCool();
const version = useVersion();
function check() {
refs.versionUpgrade?.check();
}
onReady(() => {
check();
});
</script>
<style lang="scss" scoped>
.page {
padding: 20rpx;
}
</style>