Commit 182bd1c3 by Sendya

fix: innerEditList zhCN lang

parent 5077398a
<template> <template>
<page-layout :desc="description" :title="getTitle" :link-list="linkList"> <page-layout :desc="description" :title="getTitle" :link-list="linkList">
<div slot="extra" class="extra-img"> <div slot="extra" class="extra-img">
<img :src="extraImage"/> <img :src="extraImage"/>
</div> </div>
<!-- keep-alive --> <!-- keep-alive -->
<route-view ref="content"></route-view> <route-view ref="content"></route-view>
</page-layout> </page-layout>
</template> </template>
<script> <script>
import PageLayout from './PageLayout' import PageLayout from './PageLayout'
import RouteView from './RouteView' import RouteView from './RouteView'
export default { export default {
name: "PageContent", name: "PageContent",
components: { components: {
RouteView, RouteView,
PageLayout PageLayout
}, },
data () { data () {
return { return {
title: '', title: '',
description: '', description: '',
linkList: [], linkList: [],
extraImage: '' extraImage: ''
} }
}, },
mounted () { mounted () {
this.getPageHeaderInfo() this.getPageHeaderInfo()
}, },
updated () { updated () {
this.getPageHeaderInfo() this.getPageHeaderInfo()
}, },
computed: { computed: {
getTitle () { getTitle () {
return this.$route.meta.title return this.$route.meta.title
} }
}, },
methods: { methods: {
getPageHeaderInfo () { getPageHeaderInfo () {
// eslint-disable-next-line // eslint-disable-next-line
this.title = this.$route.meta.title this.title = this.$route.meta.title
// 因为套用了一层 route-view 所以要取 ref 对象下的子节点的第一个对象 // 因为套用了一层 route-view 所以要取 ref 对象下的子节点的第一个对象
const content = this.$refs.content.$children[0] const content = this.$refs.content && this.$refs.content.$children[0]
if (content) { if (content) {
this.description = content.description this.description = content.description
this.linkList = content.linkList this.linkList = content.linkList
this.extraImage = content.extraImage this.extraImage = content.extraImage
} }
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.extra-img{ .extra-img{
margin-top: -60px; margin-top: -60px;
text-align: center; text-align: center;
width: 195px; width: 195px;
img{ img{
width: 100%; width: 100%;
} }
} }
</style> </style>
\ No newline at end of file
<template> <template>
<div class="exception"> <div class="exception">
<div class="img"> <div class="img">
<img :src="config[type].img"/> <img :src="config[type].img"/>
</div> </div>
<div class="content"> <div class="content">
<h1>{{ config[type].title }}</h1> <h1>{{ config[type].title }}</h1>
<div class="desc">{{ config[type].desc }}</div> <div class="desc">{{ config[type].desc }}</div>
<div class="action"> <div class="action">
<a-button type="primary" @click="handleToHome">返回首页</a-button> <a-button type="primary" @click="handleToHome">返回首页</a-button>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import types from './type' import types from './type'
export default { export default {
name: "Exception", name: "Exception",
props: { props: {
type: { type: {
type: Number, type: String,
default: 404 default: '404'
} }
}, },
data() { data() {
return { return {
config: types config: types
} }
}, },
methods: { methods: {
handleToHome () { handleToHome () {
this.$router.push({ name: 'dashboard' }) this.$router.push({ name: 'dashboard' })
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.exception { .exception {
min-height: 500px; min-height: 500px;
height: 80%; height: 80%;
align-items: center; align-items: center;
text-align: center; text-align: center;
margin-top: 150px; margin-top: 150px;
.img { .img {
display: inline-block; display: inline-block;
padding-right: 52px; padding-right: 52px;
zoom: 1; zoom: 1;
img { img {
height: 360px; height: 360px;
max-width: 430px; max-width: 430px;
} }
} }
.content { .content {
display: inline-block; display: inline-block;
flex: auto; flex: auto;
h1 { h1 {
color: #434e59; color: #434e59;
font-size: 72px; font-size: 72px;
font-weight: 600; font-weight: 600;
line-height: 72px; line-height: 72px;
margin-bottom: 24px; margin-bottom: 24px;
} }
.desc { .desc {
color: rgba(0, 0, 0, .45); color: rgba(0, 0, 0, .45);
font-size: 20px; font-size: 20px;
line-height: 28px; line-height: 28px;
margin-bottom: 16px; margin-bottom: 16px;
} }
} }
} }
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment