pages-edit.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <div class="pc-edit">
  3. <!-- 内容 -->
  4. <div class="content-wrap" v-show="diyStore.editTab == 'content'">
  5. <div class="edit-attr-item-wrap">
  6. <h3 class="mb-[10px]">基础设置</h3>
  7. <el-form label-width="90px" class="px-[10px]">
  8. <el-form-item label="模板名称">
  9. <el-input v-model="diyStore.name" placeholder="请输入模板名称" />
  10. </el-form-item>
  11. </el-form>
  12. </div>
  13. </div>
  14. <!-- 样式 -->
  15. <div class="style-wrap" v-show="diyStore.editTab == 'style'">
  16. <div class="edit-attr-item-wrap">
  17. <h3 class="mb-[10px]">样式设置</h3>
  18. <el-form label-width="80px" class="px-[10px]">
  19. <el-form-item label="背景颜色">
  20. <span class="mr-[10px]">{{ diyStore.backgroundColor }}</span>
  21. <el-color-picker class="mr-[10px]" v-model="diyStore.backgroundColor" />
  22. <el-button @click="diyStore.backgroundColor = '#f2f2f2'" size="small">重置</el-button>
  23. </el-form-item>
  24. <el-form-item label="悬停颜色">
  25. <span class="mr-[10px]">{{ diyStore.hoverColor }}</span>
  26. <el-color-picker class="mr-[10px]" v-model="diyStore.hoverColor" />
  27. <el-button @click="diyStore.hoverColor = '#E7000B'" size="small">重置</el-button>
  28. </el-form-item>
  29. </el-form>
  30. </div>
  31. <!-- 组件样式 -->
  32. <slot name="style"></slot>
  33. </div>
  34. </div>
  35. </template>
  36. <script lang="ts" setup>
  37. import usePcdiyStore from '@/store/modules/pcdiy';
  38. const diyStore = usePcdiyStore();
  39. </script>
  40. <style lang="scss" scoped>
  41. .pc-edit {
  42. .edit-attr-item-wrap {
  43. border-top: 2px solid var(--el-color-info-light-8);
  44. padding-top: 20px;
  45. &:first-of-type {
  46. border-top: none;
  47. padding-top: 0;
  48. }
  49. .edit-attr-title {
  50. display: flex;
  51. .title2 {
  52. font-size: 12px;
  53. color: #666;
  54. margin-left: 6px;
  55. }
  56. }
  57. .data-num {
  58. width: 100%;
  59. font-size: 14px;
  60. display: flex;
  61. align-items: center;
  62. justify-content: flex-end;
  63. color: var(--el-color-primary);
  64. cursor: pointer;
  65. }
  66. }
  67. .selected {
  68. line-height: 32px;
  69. position: absolute;
  70. left: 0px;
  71. }
  72. :deep(.el-form-item__label) {
  73. font-weight: 400;
  74. }
  75. }
  76. </style>