Commit b3b2c07e authored by 童皓's avatar 童皓

update:添加版本显示

parent 32a45507
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<image class="logo" src="https://cdn.uviewui.com/uview/common/logo.png" mode="widthFix"></image> <image class="logo" src="https://cdn.uviewui.com/uview/common/logo.png" mode="widthFix"></image>
<view class="nav-info"> <view class="nav-info">
<view class="nav-title__text"> <view class="nav-title__text">
{{$t('common.title')}} <text class="nav-info__title__text">uView {{version}}</text>
</view> </view>
<view class="nav-slogan"> <view class="nav-slogan">
{{$t('common.intro')}} {{$t('common.intro')}}
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</template> </template>
<script> <script>
export default { export default {
props: { props: {
desc: String, desc: String,
title: String, title: String,
...@@ -31,6 +31,11 @@ ...@@ -31,6 +31,11 @@
return this.$i18n.locale == 'zh' ? 'zh' : 'en'; return this.$i18n.locale == 'zh' ? 'zh' : 'en';
} }
}, },
data() {
return {
version: uni.$u.config.v
}
},
methods: { methods: {
switchLang() { switchLang() {
this.$i18n.locale = this.$i18n.locale == 'en' ? 'zh' : 'en'; this.$i18n.locale = this.$i18n.locale == 'en' ? 'zh' : 'en';
...@@ -42,57 +47,57 @@ ...@@ -42,57 +47,57 @@
}); });
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.nav-wrap { .nav-wrap {
padding: 15px; padding: 15px;
position: relative; position: relative;
} }
.lang { .lang {
position: absolute; position: absolute;
top: 15px; top: 15px;
right: 15px; right: 15px;
} }
.nav-title { .nav-title {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
display: flex; display: flex;
/* #endif */ /* #endif */
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
} }
.nav-info { .nav-info {
margin-left: 15px; margin-left: 15px;
} }
.nav-title__text { .nav-title__text {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
display: flex; display: flex;
/* #endif */ /* #endif */
color: $u-main-color; color: $u-main-color;
font-size: 25px; font-size: 25px;
font-weight: bold; font-weight: bold;
} }
.logo { .logo {
width: 70px; width: 70px;
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
height: auto; height: auto;
/* #endif */ /* #endif */
} }
.nav-slogan { .nav-slogan {
color: $u-tips-color; color: $u-tips-color;
font-size: 14px; font-size: 14px;
} }
.nav-desc { .nav-desc {
margin-top: 10px; margin-top: 10px;
font-size: 14px; font-size: 14px;
color: $u-content-color; color: $u-content-color;
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment