新增动态获取version

This commit is contained in:
gyq
2025-01-08 18:20:45 +08:00
parent e04685a9ff
commit f542287d32

View File

@@ -26,12 +26,17 @@
<up-icon name="arrow-right" />
</view>
</view>
<view class="version">1.1.14</view>
<view class="version">{{ version }}</view>
</view>
</template>
<script setup>
import { ref } from 'vue';
import { linkTo } from '@/utils/app.js';
import { onLoad } from '@dcloudio/uni-app';
const version = ref('');
// 退出登录
function logout() {
uni.showModal({
@@ -47,6 +52,16 @@ function logout() {
}
});
}
onLoad(() => {
const systemInfo = uni.getSystemInfoSync();
//#ifdef APP-PLUS
version.value = systemInfo.appWgtVersion;
//#endif
// #ifdef H5
version.value = systemInfo.appVersion;
// #endif
});
</script>
<style scoped lang="scss">