Compare commits

..

No commits in common. 'f000c0925608acae393d2ee1c2e26f7202d3266a' and 'be7b8641a59d7a3f443a08be164f2e30288faa9c' have entirely different histories.

  1. 39
      src/layout/components/navbar/index.vue
  2. 15
      src/store/getters.js
  3. 6
      src/store/index.js
  4. 19
      src/store/modules/screen.js
  5. 24
      src/views/home/index.vue
  6. 26
      src/views/sodemo/index.vue
  7. 16
      src/views/soui/index.vue

@ -1,15 +1,15 @@
<template> <template>
<div id="navbar"> <div id="navbar">
<el-menu <el-menu
:default-active="activeMenu" :default-active="activeMenu"
:background-color="variables.menuBg" :background-color="variables.menuBg"
:text-color="variables.menuText" :text-color="variables.menuText"
:active-text-color="variables.menuActiveText" :active-text-color="variables.menuActiveText"
:unique-opened="false" :unique-opened="false"
:collapse-transition="false" :collapse-transition="false"
mode="horizontal" mode="horizontal"
:router="true" :router="true"
:style="screenPadding" :style="menuStyle"
> >
<el-col :xs="menuItemSize.xs" :sm="menuItemSize.sm" :md="menuItemSize.md" :lg="menuItemSize.lg" <el-col :xs="menuItemSize.xs" :sm="menuItemSize.sm" :md="menuItemSize.md" :lg="menuItemSize.lg"
:xl="menuItemSize.xl" :xl="menuItemSize.xl"
@ -42,7 +42,7 @@ export default {
}, },
computed: { computed: {
...mapGetters([ ...mapGetters([
'routes', 'routes'
]), ]),
menuItemSize() { menuItemSize() {
return { return {
@ -53,18 +53,11 @@ export default {
xl: 2 xl: 2
} }
}, },
screenPadding() { menuStyle() {
if (this.screenWidth >= 600) { if (this.screenWidth >= 600) {
if (this.screenWidth >= 1000) { return {
return { paddingLeft: '15%',
paddingLeft: '15%', paddingRight: '15%'
paddingRight: '15%'
}
} else {
return {
paddingLeft: '5%',
paddingRight: '5%'
}
} }
} else { } else {
return {} return {}
@ -86,7 +79,6 @@ export default {
mounted() { mounted() {
window.onresize = () => { window.onresize = () => {
this.screenWidth = document.body.clientWidth this.screenWidth = document.body.clientWidth
this.$store.commit('screen/UPDATE_SCREEN_WIDTH', document.body.clientWidth)
} }
// console.log('routes -> ', this.routes) // console.log('routes -> ', this.routes)
}, },
@ -96,12 +88,11 @@ export default {
if (!this.timer) { if (!this.timer) {
// screenWidthdatascreenWidth // screenWidthdatascreenWidth
this.screenWidth = newValue; this.screenWidth = newValue;
this.$store.commit('screen/UPDATE_SCREEN_WIDTH', newValue)
this.timer = true; this.timer = true;
setTimeout(() => { setTimeout(() => {
//console.log(this.screenWidth); //console.log(this.screenWidth);
this.timer = false; this.timer = false;
}, 1250); }, 400);
} }
} }
}, },

@ -1,18 +1,5 @@
const getters = { const getters = {
routes: state => state.menu.routes, routes: state => state.menu.routes
screenWidth: state => state.screen.screenWidth,
screenPadding: state => {
let width = state.screen.screenWidth
if (width >= 600) {
if (width >= 1000) {
return {paddingLeft: '15%', paddingRight: '15%'}
} else {
return {paddingLeft: '5%', paddingRight: '5%'}
}
} else {
return {}
}
}
} }
export default getters export default getters

@ -1,15 +1,13 @@
import Vue from 'vue' import Vue from 'vue'
import Vuex from 'vuex' import Vuex from 'vuex'
import getters from "@/store/getters"; import getters from "@/store/getters";
import menu from "@/store/modules/menu"; import menu from "@/store/modules/menu"
import screen from "@/store/modules/screen";
Vue.use(Vuex) Vue.use(Vuex)
const store = new Vuex.Store({ const store = new Vuex.Store({
modules: { modules: {
menu, menu
screen
}, },
getters getters
}) })

@ -1,19 +0,0 @@
const state = {
screenWidth: document.body.clientWidth
}
const mutations = {
UPDATE_SCREEN_WIDTH(state, value) {
state.screenWidth = value
console.log('run update screen width')
}
}
const actions = {}
export default {
namespaced: true,
state,
mutations,
actions
}

@ -1,10 +1,10 @@
<template> <template>
<div id="home" :style="screenPadding"> <div id="home">
<!-- 这是一个首页 <br>--> <!-- 这是一个首页 <br>-->
<!-- 如你所见它现在还什么都没有但马上就会有了 <br>--> <!-- 如你所见它现在还什么都没有但马上就会有了 <br>-->
<!-- By Soul2--> <!-- By Soul2-->
<el-card shadow="always"> <el-card shadow="always">
<el-collapse :accordion="false" v-model="expand" style="text-align: left"> <el-collapse :accordion="accordion" v-model="expand" style="text-align: left">
<el-collapse-item name="openShow"> <el-collapse-item name="openShow">
<template slot="title"> <template slot="title">
关于灵魂演示 关于灵魂演示
@ -59,7 +59,7 @@
</el-link> </el-link>
一次性下载所有演示地图也可以通过点击下方各个按钮以你希望的方式下载你所需要的特定演示地图 一次性下载所有演示地图也可以通过点击下方各个按钮以你希望的方式下载你所需要的特定演示地图
</p> </p>
<div id="dl-btn"> <div style="margin-top: 7px;">
<el-button size="mini" class="el-icon-position" <el-button size="mini" class="el-icon-position"
@click="goto('https://wow8.org/soul-demo/')" @click="goto('https://wow8.org/soul-demo/')"
> >
@ -104,18 +104,13 @@
<script> <script>
import {mapGetters} from "vuex";
export default { export default {
name: "Home", name: "Home",
components: {}, components: {},
computed: { computed: {
...mapGetters([
"screenPadding"
]),
expand() { expand() {
return ['openShow', 'soui'] return ['openShow', 'soui']
}, }
}, },
methods: { methods: {
goto(where) { goto(where) {
@ -126,7 +121,14 @@ export default {
</script> </script>
<style scoped> <style scoped>
#dl-btn .el-button { @import "~@/style/layout/index.scss";
margin-top: 7px;
#home {
padding-left: 15%;
padding-right: 15%;
}
a {
} }
</style> </style>

@ -1,5 +1,5 @@
<template> <template>
<div id="so-demo" :style="screenPadding"> <div id="so-demo" style="padding: 0 15%;">
<el-card shadow="always"> <el-card shadow="always">
<div slot="header"> <div slot="header">
关于灵魂演示 关于灵魂演示
@ -50,7 +50,7 @@
</el-link> </el-link>
一次性下载所有演示地图也可以通过点击下方各个按钮以你希望的方式下载你所需要的特定演示地图 一次性下载所有演示地图也可以通过点击下方各个按钮以你希望的方式下载你所需要的特定演示地图
</p> </p>
<div id="goto-btn"> <div style="margin-top: 7px;">
<el-button size="mini" class="el-icon-position" <el-button size="mini" class="el-icon-position"
@click="goto('https://wow8.org/soul-demo/')" @click="goto('https://wow8.org/soul-demo/')"
> >
@ -92,29 +92,11 @@
</template> </template>
<script> <script>
import {mapGetters} from "vuex";
export default { export default {
name: "SoDemo", name: "SoDemo"
computed: {
...mapGetters([
"screenPadding"
]),
},
methods: {
goto(where) {
location.href = where
}
}
} }
</script> </script>
<style scoped lang="scss"> <style scoped>
#goto-btn {
text-align: left;
}
#goto-btn .el-button {
margin-top: 7px;
}
</style> </style>

@ -1,5 +1,5 @@
<template> <template>
<div id="soui" style="text-align: left;" :style="screenPadding"> <div id="soui" style="text-align: left;padding: 0 15%;">
<el-card shadow="always"> <el-card shadow="always">
<div class="title" slot="header" style="text-align: center"> <div class="title" slot="header" style="text-align: center">
关于SoUI 关于SoUI
@ -45,20 +45,8 @@
</template> </template>
<script> <script>
import {mapGetters} from "vuex";
export default { export default {
name: "SoUi", name: "SoUi"
computed: {
...mapGetters([
"screenPadding"
]),
},
methods: {
goto(where) {
location.href = where
}
}
} }
</script> </script>

Loading…
Cancel
Save