|
|
- <script>
- export default {
- onLaunch: function() {
- console.log('App Launch')
- // window.$messageMap = {
- // '500' : this.$t('message.500'),
- // '512' : this.$t('message.512'),
- // '511' : this.$t('message.511'),
- // }
- if(!uni.getStorageSync('language')){
- this.$i18n.locale = 'en'
-
- //#ifdef H5
- this.$router.go(0);
- //#endif
- //#ifdef APP-PLUS
- // uni.navigateTo({
- // url: '/pages/home/home' // 要刷新的页面路径
- // });
- //#endif
-
- uni.setStorage({
- key: 'language',
- data: 'en'
- })
- uni.setLocale('en')
- }
-
- },
- onShow: function() {
- console.log('App Show')
- },
- onHide: function() {
- console.log('App Hide')
- }
- }
- </script>
-
- <style lang="scss">
- /*每个页面公共css */
- @import '@/uni_modules/uview-ui/theme.scss';
- body{
- background-color: #f3f3f3;
- }
- </style>
|