12345678910111213141516171819202122232425262728293031323334353637383940 |
- <script>
- export default {
- onLaunch() {
- console.log('App Launch')
- },
- onShow() {
- // #ifdef H5
- if (sessionStorage.getItem('store')) {
- this.$store.replaceState(Object.assign({}, this.$store.state, JSON.parse(sessionStorage.getItem(
- 'store'))));
- sessionStorage.setItem('store', ''); //重新置完清空session
- }
- window.addEventListener('beforeunload', () => {
- sessionStorage.setItem('store', JSON.stringify(this.$store.state));
- });
- // #endif
- // #ifdef MP-WEIXIN
- // #endif
- },
- onHide() {}
- }
- </script>
- <style lang="scss">
- /*每个页面公共css */
- @import '@/uni_modules/uni-scss/index.scss';
- // 设置整个项目的背景色
- page {
- color: $uni-main-color;
- font-size: 28rpx;
- background: $uni-background-color;
- img {
- width: 100%;
- height: 100%;
- }
- }
- </style>
|