detail-frame.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <div id="detail-frame" :style="`height:${heights}px`">
  3. <el-scrollbar style="height:100%">
  4. <el-card style="background:rgb(231, 224, 235);border-radius: 60px;" shadow="hover">
  5. <el-row>
  6. <el-col :span="24" class="title">
  7. <span v-if="returns">
  8. <el-button
  9. size="mini"
  10. plan
  11. circle
  12. @click="$router.push({ path: returns })"
  13. style="box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)"
  14. >
  15. <span class="el-icon-arrow-left" style="zoom:1.5;font-weight:700"></span>
  16. </el-button>
  17. </span>
  18. <slot name="title">
  19. {{ title }}
  20. </slot>
  21. </el-col>
  22. </el-row>
  23. <div style="padding:1.875rem;">
  24. <slot></slot>
  25. </div>
  26. </el-card>
  27. </el-scrollbar>
  28. </div>
  29. </template>
  30. <script>
  31. export default {
  32. name: 'detail-frame',
  33. props: {
  34. title: { type: String },
  35. returns: { type: null, default: null },
  36. },
  37. components: {},
  38. data: () => ({
  39. heights: document.documentElement.clientHeight - 80,
  40. }),
  41. created() {},
  42. mounted() {
  43. const that = this;
  44. window.onresize = () => {
  45. return (() => {
  46. window.fullHeight = document.documentElement.clientHeight - 80;
  47. that.heights = window.fullHeight;
  48. })();
  49. };
  50. },
  51. computed: {},
  52. methods: {},
  53. };
  54. </script>
  55. <style lang="less" scoped>
  56. .title {
  57. font-size: 1rem;
  58. font-weight: 700;
  59. padding: 1rem;
  60. }
  61. /deep/.el-scrollbar__wrap {
  62. overflow-x: auto;
  63. }
  64. </style>