form-diy-menus.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template id="form-diy-menus">
  2. <div class="diy_l_box">
  3. <div class="diy_d_box" v-for="(t,ti) in list" :key="ti">
  4. <div class="diy_l_tag_box">
  5. {{t.title}}
  6. </div>
  7. <div class="form_tool_diy_box" >
  8. <div class="foem_tool_l_box" @click="chooseTool(y)" v-for="(y,yi) in t.toolList" :key="yi">
  9. <!-- <el-image :src="require(y.icon)" class="form_img_diy" ></el-image> -->
  10. <img class="form_img_diy" :src="y.img" />
  11. <div>
  12. <span>{{y.title}}</span>
  13. </div>
  14. </div>
  15. </div>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. Vue.component('form-diy-menus',{
  21. template: '#form-diy-menus',
  22. props:{
  23. list:{
  24. type: Array,
  25. default:[],
  26. tempalateStr: "resources/img/decorate/func/template.png"
  27. }
  28. },
  29. methods:{
  30. chooseTool(item){
  31. console.log(item)
  32. this.$emit('add-prev-item',item)
  33. }
  34. }
  35. })
  36. </script>
  37. <style scoped>
  38. .diy_l_box{
  39. width: 260px;
  40. height: 80vh;
  41. overflow-y: auto;
  42. border-left: 1px solid #efefef;
  43. padding-bottom: 30px;
  44. }
  45. .diy_d_box{
  46. width: 100%;
  47. }
  48. .diy_l_tag_box{
  49. width: 100%;
  50. height: 32px;
  51. line-height: 32px;
  52. padding-left: 12px;
  53. padding-right: 12px;
  54. border-bottom: 1px solid #efefef;
  55. border-right: 1px solid #efefef;
  56. color: #6b7685;
  57. font-size: 12px;
  58. font-weight: 700;
  59. float: left;
  60. background: #fafafa;
  61. }
  62. .form_tool_diy_box{
  63. width: 100%;
  64. display: flex;
  65. align-items: center;
  66. flex-wrap: wrap;
  67. }
  68. .foem_tool_l_box{
  69. height: 60px;
  70. width: 33.33%;
  71. text-align: center;
  72. border-bottom: 1px solid #f3f3f3;
  73. border-right: 1px solid #f3f3f3;
  74. border-radius: 0;
  75. color: #999;
  76. font-size: 12px;
  77. padding: 0;
  78. float: left;
  79. cursor: pointer;
  80. }
  81. .form_img_diy{
  82. width: 19px;
  83. height: 19px;
  84. margin-top: 10px;
  85. }
  86. </style>