123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <template>
- <div id="app">
- <router-view></router-view>
- </div>
- </template>
- <script>
- export default {
- name: 'app',
- data() {
- return {
- }
- },
- created () {
- //在页面加载时读取sessionStorage里的状态信息
- if (sessionStorage.getItem("store") ) {
- this.$store.replaceState(Object.assign({}, this.$store.state,JSON.parse(sessionStorage.getItem("store"))))
- }
- //在页面刷新时将vuex里的信息保存到sessionStorage里
- window.addEventListener("beforeunload",() => {
- sessionStorage.setItem("store",JSON.stringify(this.$store.state))
- })
- //
- // console.log(this.$route.query.accessToken)
- // sessionStorage.setItem("accessToken", this.$route.query.accessToken);
- },
- methods: {
- initWindow() {
- let whdef = 100 / 1920 // 表示1920的设计图,使用100PX的默认值
- // let wH = window.innerHeight // 当前窗口的高度
- let wW = window.innerWidth // 当前窗口的宽度
- let rem = wW * whdef // 以默认比例值乘以当前窗口宽度,得到该宽度下的相应FONT-SIZE值
- let html = document.getElementsByTagName('html')[0]
- html.style.fontSize = rem + 'px'
- }
- },
- mounted() {
- let self = this
- this.initWindow()
- window.onresize = () => {
- self.initWindow()
- }
- }
- }
- </script>
- <style>
- @charset "utf-8";
- body,
- div,
- dl,
- dt,
- dd,
- ul,
- ol,
- li,
- h1,
- h2,
- h3,
- h4,
- h5,
- h6,
- pre,
- form,
- fieldset,
- input,
- textarea,
- p,
- blockquote,
- th,
- td,
- label,
- botton {
- margin: 0;
- padding: 0;
- font-size: 12px;
- }
- table {
- border-collapse: initial;
- border-spacing: 0;
- }
- fieldset,
- img {
- border: 0;
- }
- address,
- caption,
- cite,
- code,
- dfn,
- em,
- strong,
- th,
- var {
- font-style: normal;
- font-weight: normal;
- }
- ol,
- ul {
- list-style: none;
- }
- caption,
- th {
- text-align: left;
- }
- /* h1,h2,h3,h4,h5,h6 {
- font-weight:normal;
- } */
- q:before,
- q:after {
- content: "";
- }
- abbr,
- acronym {
- border: 0;
- }
- * {
- margin: 0px;
- padding: 0px;
- }
- a {
- text-decoration: none;
- }
- li {
- list-style: none;
- }
- input,
- img {
- border: none;
- }
- .icon {
- width: 1em;
- height: 1em;
- vertical-align: -0.15em;
- fill: currentColor;
- overflow: hidden;
- }
- </style>
|