Files
Goodgame_web/pages/part/layouts.vue
T
我是个攻城狮 c3f5f13bb3 all
2026-05-27 16:01:15 +08:00

88 lines
1.5 KiB
Vue

<template>
<view>
<Header :index="index" :name="detail.name"></Header>
<slot/>
<Footer :data="detail" ></Footer>
</view>
</template>
<script>
import Header from './header.vue';
import Footer from './footer.vue';
export default {
props:{
index:{
type: Number,
default: 0
},
banner:{
type: Number,
default: 0
},
img: {
default: '',
},
imgs: {
default: '',
},
titles: {
default: '',
},
title_content: {
default: '',
},
},
components:{
Header,
Footer,
},
data(){
return {
detail:{
name: '',
},
isMobile:false
}
},
created() {
this.getSet();
},
mounted() {
this.checkIsMobile();
window.addEventListener("resize", this.checkIsMobile);
},
beforeDestroy() {
window.removeEventListener("resize", this.checkIsMobile);
},
methods:{
checkIsMobile() {
const width = window.innerWidth;
const height = window.innerHeight;
const mobileWidth = 768; // 可以根据需要调整这个值
this.isMobile = width <= mobileWidth || height <= mobileWidth;
},
// getData(){
// this._get('cms.cms/index',{
// },res=>{
// this.detail = res.data.data;
// this.$emit('aboutData',this.detail);
// })
// }
getSet(){
this._get('game.index/setting',{
},res=>{
this.detail = res.data.set;
// console.log(this.set,22)
});
},
}
}
</script>
<style lang="scss">
</style>