|
@@ -4,30 +4,43 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
- export default {
|
|
|
- name: 'App',
|
|
|
- provide (){
|
|
|
- return {
|
|
|
- reload:this.reload,
|
|
|
- }
|
|
|
+export default {
|
|
|
+ name: 'App',
|
|
|
+ provide() {
|
|
|
+ return {
|
|
|
+ reload: this.reload,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ isRouterAlive: true,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ // 在组件创建时检测设备类型
|
|
|
+ this.detectDeviceType();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ reload() {
|
|
|
+ this.isRouterAlive = false;
|
|
|
+ this.$nextTick(function () {
|
|
|
+ this.isRouterAlive = true;
|
|
|
+ });
|
|
|
+ //this.noreadCounts()
|
|
|
},
|
|
|
- data(){
|
|
|
- return {
|
|
|
- isRouterAlive:true,
|
|
|
+ // 监听访问网页的设备类型
|
|
|
+ detectDeviceType() {
|
|
|
+ const userAgent = navigator.userAgent;
|
|
|
+ // 判断是否是移动端设备的一般方法
|
|
|
+ const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent);
|
|
|
+ if (isMobile) {
|
|
|
+ // 跳转到移动端
|
|
|
+ window.location.replace(process.env.VUE_APP_MOBILE);
|
|
|
}
|
|
|
},
|
|
|
- methods:{
|
|
|
- reload (){
|
|
|
- this.isRouterAlive = false
|
|
|
- this.$nextTick(function(){
|
|
|
- this.isRouterAlive = true
|
|
|
- })
|
|
|
- //this.noreadCounts()
|
|
|
- },
|
|
|
- },
|
|
|
- components:{
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ components: {},
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -45,9 +58,8 @@
|
|
|
color: #42b983;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
-.el-table th.gutter{
|
|
|
- display: table-cell!important;
|
|
|
+.el-table th.gutter {
|
|
|
+ display: table-cell !important;
|
|
|
}
|
|
|
</style>
|