| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <template>
- <div id="app">
- <router-view v-if="isRouterAlive" />
- <el-backtop :bottom="16" :right="20" :visibility-height="1100" class="backtop">
- <div><i class="el-icon-caret-top" style="color:#ee7000;"></i></div>
- </el-backtop>
- </div>
- </template>
- <script>
- export default {
- name: "App",
- provide() {
- return {
- reload: this.reload,
- };
- },
- data() {
- return {
- isRouterAlive: true,
- };
- },
- methods: {
- reload() {
- this.isRouterAlive = false;
- this.$nextTick(function () {
- this.isRouterAlive = true;
- });
- },
- },
- };
- </script>
- <style>
- .icon {
- width: 34px;
- height: 34px;
- vertical-align: -0.15em;
- fill: currentColor;
- overflow: hidden;
- }
- .backtop {
- position: fixed;
- background-color: #FFF;
- width: 40px;
- height: 40px;
- border-radius: 50%;
- display: -webkit-box;
- display: -ms-flexbox;
- display: flex;
- -webkit-box-align: center;
- -ms-flex-align: center;
- align-items: center;
- -webkit-box-pack: center;
- -ms-flex-pack: center;
- justify-content: center;
- font-size: 20px;
- -webkit-box-shadow: 0 0 6px rgba(0, 0, 0, .12);
- box-shadow: 0 0 6px rgba(0, 0, 0, .12);
- cursor: pointer;
- z-index: 999;
- }
- </style>
|