box-item.blade.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <style>
  2. body{background-color: #efefef;}
  3. [v-cloak] {display: none;}
  4. .vue-title-yz-modular {
  5. padding: 10px;
  6. margin: 20px 0;
  7. background-color: #fff;
  8. border-radius: 8px;
  9. }
  10. .vue-title-yz-box {
  11. display: flex;
  12. margin: 5px 0;
  13. line-height: 32px;
  14. font-size: 18px;
  15. color: #333;
  16. font-weight: 600;
  17. }
  18. .vue-title-yz-green {
  19. width: 4px;
  20. height: 18px;
  21. margin-top: 6px;
  22. background: #29ba9c;
  23. display: inline-block;
  24. margin-right: 10px;
  25. }
  26. .vue-title-yz-text {
  27. flex: 1;
  28. font-size: 14px;
  29. }
  30. .vue-title-yz-text span:nth-child(n+2) {
  31. color: #999;
  32. margin-left: 20px;
  33. font-weight: 400;
  34. font-size: 14px;
  35. }
  36. .vue-page{
  37. border-radius: 5px;
  38. width: calc(100% - 266px);
  39. margin-right: 10px;
  40. position: fixed;
  41. bottom: 0;
  42. right: 0;
  43. padding: 15px 5% 15px 0;
  44. background: #fff;
  45. height: 60px;
  46. z-index: 999;
  47. box-shadow: 0 2px 9px rgb(51 51 51 / 10%);
  48. display: flex;
  49. justify-content: center;
  50. align-items: center;
  51. }
  52. </style>
  53. <script>
  54. Vue.component("box-item", {
  55. delimiters: ['[[', ']]'],
  56. props: {
  57. text: {
  58. type: String | Array
  59. }
  60. },
  61. template: `<div class="vue-title-yz-modular">
  62. <div class="vue-title-yz-box" v-if="textList.length>0">
  63. <div class="vue-title-yz-green"></div>
  64. <div class="vue-title-yz-text"><span v-for="(text,i) in textList" :key="i">[[text]]</span></div>
  65. <slot name="btn"></slot>
  66. </div>
  67. <slot></slot>
  68. </div>`,
  69. computed: {
  70. textList() {
  71. if (Array.isArray(this.text)) return this.text;
  72. else return [this.text];
  73. }
  74. }
  75. })
  76. Vue.component("vue-page",{
  77. delimiters: ['[[', ']]'],
  78. template:`<div class="vue-page-box">
  79. <div style="height:60px;"></div>
  80. <div class="vue-page"><slot></slot></div>
  81. </div>`
  82. })
  83. </script>