2018-01-14 22:51:12 +08:00
|
|
|
<template>
|
2018-06-09 22:39:05 +08:00
|
|
|
<el-card class="d2-mb">
|
|
|
|
|
<div slot="header" class="d2-clearfix">
|
2018-01-14 22:51:12 +08:00
|
|
|
<el-button type="text" size="mini">{{title}}</el-button>
|
|
|
|
|
<el-tooltip content="重新 mock 数据" placement="top-end">
|
2018-06-09 22:39:05 +08:00
|
|
|
<el-button type="primary" size="mini" @click="$emit('reload')" class="d2-fr">刷新</el-button>
|
2018-01-14 22:51:12 +08:00
|
|
|
</el-tooltip>
|
|
|
|
|
</div>
|
|
|
|
|
<el-row :gutter="10">
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<div class="col col-l">
|
2018-06-10 09:21:26 +08:00
|
|
|
<d2-highlight :code="code"/>
|
2018-01-14 22:51:12 +08:00
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<div class="col col-r">
|
2018-06-10 09:21:26 +08:00
|
|
|
<d2-highlight :code="mock"/>
|
2018-01-14 22:51:12 +08:00
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-card>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
props: {
|
|
|
|
|
title: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: false,
|
|
|
|
|
default: 'Mock Demo'
|
|
|
|
|
},
|
|
|
|
|
code: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: false,
|
|
|
|
|
default: ''
|
|
|
|
|
},
|
|
|
|
|
mock: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: false,
|
|
|
|
|
default: ''
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
@import '~@/assets/style/public.scss';
|
|
|
|
|
.col {
|
|
|
|
|
padding: $margin;
|
2018-01-17 16:01:46 +08:00
|
|
|
border-radius: 4px;
|
2018-01-14 22:51:12 +08:00
|
|
|
border-width: 1px;
|
|
|
|
|
border-style: solid;
|
2018-01-15 17:17:22 +08:00
|
|
|
font-size: 16px;
|
2018-01-14 22:51:12 +08:00
|
|
|
}
|
|
|
|
|
.col-l {
|
|
|
|
|
background-color: lighten($color-info, 40%);
|
|
|
|
|
border-color: lighten($color-info, 35%);
|
|
|
|
|
}
|
|
|
|
|
.col-r {
|
|
|
|
|
background-color: lighten($color-success, 47%);
|
|
|
|
|
border-color: lighten($color-success, 40%);
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
|