Commit b3b2c07e authored by 童皓's avatar 童皓

update:添加版本显示

parent 32a45507
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
<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')}}
</view> </view>
</view> </view>
</view> </view>
...@@ -21,78 +21,83 @@ ...@@ -21,78 +21,83 @@
</template> </template>
<script> <script>
export default { export default {
props: { props: {
desc: String, desc: String,
title: String, title: String,
}, },
computed: { computed: {
lang() { lang() {
return this.$i18n.locale == 'zh' ? 'zh' : 'en'; return this.$i18n.locale == 'zh' ? 'zh' : 'en';
} }
}, },
methods: { data() {
switchLang() { return {
this.$i18n.locale = this.$i18n.locale == 'en' ? 'zh' : 'en'; version: uni.$u.config.v
this.vuex_tabbar[0].text = this.$t('nav.components') }
this.vuex_tabbar[1].text = this.$t('nav.js') },
this.vuex_tabbar[2].text = this.$t('nav.template') methods: {
uni.setNavigationBarTitle({ switchLang() {
title: this.$t(this.title) this.$i18n.locale = this.$i18n.locale == 'en' ? 'zh' : 'en';
}); this.vuex_tabbar[0].text = this.$t('nav.components')
} this.vuex_tabbar[1].text = this.$t('nav.js')
this.vuex_tabbar[2].text = this.$t('nav.template')
uni.setNavigationBarTitle({
title: this.$t(this.title)
});
} }
} }
}
</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