1.代码优化

sws 2024-09-02
v1.0.0
sws 2024-09-02 09:50:15 +08:00
parent 852d1efd3a
commit 5b8d8ce9bf
5 changed files with 9 additions and 8 deletions

View File

@ -63,7 +63,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { get_math } from '@/utils'; import { get_math } from '@/utils';
import ArticleAPI from '@/api/article'; import ArticleAPI from '@/api/article';
import { articleStore } from '@/store/article'; import { articleStore } from '@/store';
const article_store = articleStore(); const article_store = articleStore();
const props = defineProps({ const props = defineProps({
value: { value: {

View File

@ -88,7 +88,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { get_math, tabs_style } from '@/utils'; import { get_math, tabs_style } from '@/utils';
import ArticleAPI from '@/api/article'; import ArticleAPI from '@/api/article';
import { articleStore } from '@/store/article'; import { articleStore } from '@/store';
const article_store = articleStore(); const article_store = articleStore();
const props = defineProps({ const props = defineProps({
value: { value: {

View File

@ -24,7 +24,7 @@
<li v-for="(item, index) in diy_data" :key="index" :class="['flex ptb-12 plr-10 gap-y-8 re align-c drawer-drag', { 'drawer-drag-bg': item.show_tabs }]" @click="on_choose(index, item.show_tabs)"> <li v-for="(item, index) in diy_data" :key="index" :class="['flex ptb-12 plr-10 gap-y-8 re align-c drawer-drag', { 'drawer-drag-bg': item.show_tabs }]" @click="on_choose(index, item.show_tabs)">
<el-icon class="iconfont icon-drag size-16 cr-d" /> <el-icon class="iconfont icon-drag size-16 cr-d" />
<span class="size-12 cr-6">{{ item.name }}</span> <span class="size-12 cr-6">{{ item.name }}</span>
<el-icon class="iconfont icon-close-b size-16 abs" :style="[ item.show_tabs ? '' : 'display:none']" @click.stop="del(index)" /> <el-icon class="iconfont icon-close-b size-16 abs" :style="[item.show_tabs ? '' : 'display:none']" @click.stop="del(index)" />
</li> </li>
</TransitionGroup> </TransitionGroup>
</VueDraggable> </VueDraggable>
@ -46,7 +46,7 @@
<!-- 页面设置 --> <!-- 页面设置 -->
<page-settings :show-page="page_data.show_tabs" :page-data="page_data" @page_settings="page_settings"></page-settings> <page-settings :show-page="page_data.show_tabs" :page-data="page_data" @page_settings="page_settings"></page-settings>
<div class="model-wall" :style="content_style"> <div class="model-wall" :style="content_style">
<div :style="`padding-top:${ top_padding }px; margin-top: ${ top_margin }px;padding-bottom:${ bottom_navigation_show ? footer_nav_counter_store.padding_footer : 0 }px;`"> <div :style="`padding-top:${top_padding}px; margin-top: ${top_margin}px;padding-bottom:${bottom_navigation_show ? footer_nav_counter_store.padding_footer : 0}px;`">
<VueDraggable v-model="diy_data" :animation="500" :touch-start-threshold="2" group="people" class="drag-area re" ghost-class="ghost" :on-sort="on_sort" :on-start="on_start" :on-end="on_end"> <VueDraggable v-model="diy_data" :animation="500" :touch-start-threshold="2" group="people" class="drag-area re" ghost-class="ghost" :on-sort="on_sort" :on-start="on_start" :on-end="on_end">
<div v-for="(item, index) in diy_data" :key="item.id" :class="model_class(item)" :style="model_style(item)" @click="on_choose(index, item.show_tabs)"> <div v-for="(item, index) in diy_data" :key="item.id" :class="model_class(item)" :style="model_style(item)" @click="on_choose(index, item.show_tabs)">
<div v-if="item.show_tabs" class="plug-in-right" chosenClass="close"> <div v-if="item.show_tabs" class="plug-in-right" chosenClass="close">
@ -165,7 +165,7 @@ import { background_computer, get_math, gradient_computer, padding_computer, rad
import { cloneDeep } from 'lodash'; import { cloneDeep } from 'lodash';
import { SortableEvent, VueDraggable } from 'vue-draggable-plus'; import { SortableEvent, VueDraggable } from 'vue-draggable-plus';
import defaultSettings from './index'; import defaultSettings from './index';
import { footerNavCounterStore } from '@/store/modules/footer-nav-content'; import { footerNavCounterStore } from '@/store';
const footer_nav_counter_store = footerNavCounterStore(); const footer_nav_counter_store = footerNavCounterStore();
const app = getCurrentInstance(); const app = getCurrentInstance();
import { isEmpty } from 'lodash'; import { isEmpty } from 'lodash';
@ -213,7 +213,7 @@ watchEffect(() => {
if (data) { if (data) {
// //
const content = data.content; const content = data.content;
bottom_navigation_show.value = content.bottom_navigation_show == '1' ? true: false; bottom_navigation_show.value = content.bottom_navigation_show == '1' ? true : false;
// //
const new_style = data.style; const new_style = data.style;
content_style.value = gradient_computer(new_style.common_style) + background_computer(new_style.common_style); content_style.value = gradient_computer(new_style.common_style) + background_computer(new_style.common_style);

View File

@ -12,4 +12,5 @@ export * from './modules/upload';
export * from './modules/shop'; export * from './modules/shop';
export * from './modules/url-value'; export * from './modules/url-value';
export * from './modules/custom'; export * from './modules/custom';
export * from './modules/article';
export { store }; export { store };