diff --git a/src/components/common/url-value/index.vue b/src/components/common/url-value/index.vue index fcaf0f5d..3ced986e 100644 --- a/src/components/common/url-value/index.vue +++ b/src/components/common/url-value/index.vue @@ -1,6 +1,6 @@ @@ -44,7 +44,7 @@ const props = defineProps({ }, isDisabled: { type: Boolean, - default: true, + default: false, }, }); const modelValue = defineModel({ type: Object, default: {} }); diff --git a/src/components/footer-nav/footer-nav-content.vue b/src/components/footer-nav/footer-nav-content.vue index f2b47716..78823346 100644 --- a/src/components/footer-nav/footer-nav-content.vue +++ b/src/components/footer-nav/footer-nav-content.vue @@ -28,35 +28,82 @@
图片建议宽高80*80,鼠标拖拽左侧圆点可调整导航顺序
@@ -95,6 +142,16 @@ const props = defineProps({ }); const form = ref(props.value); const emit = defineEmits(['update:value']); +const not_drag_list = ref([]); +const drag_list = ref([]); +onBeforeMount(() => { + // 先将数组拆分成两个数组 + const data = form.value.nav_content; + not_drag_list.value = [{...data[0] }]; + drag_list.value = data.splice(1); + // 为确保数据渲染,将两个数组合并成原有数组,确保数据渲染正常 + form.value.nav_content = not_drag_list.value.concat(drag_list.value); +}); // 导航样式change事件 const nav_style_change = (style: any) => { form.value.nav_style = style; @@ -106,13 +163,23 @@ const nav_type_change = (type: any) => { emit('update:value', form.value); }; // data_list移除事件 -const nav_content_remove = (index: number) => { - form.value.nav_content.splice(index, 1); +const nav_content_remove = (index: number, type?: string) => { + if (type === 'not-drag') { + form.value.nav_content.splice(index + 1, 1); + } else { + form.value.nav_content.splice(index, 1); + } emit('update:value', form.value); }; // 拖拽排序事件 -const on_sort = (item: any) => { - form.value.nav_content = item; +const on_sort = (item: any[], type?: string) => { + if (type === 'not-drag') { + item.forEach((item1: any, index: number) => { + form.value.nav_content[index + 1] = item1; + }); + } else { + form.value.nav_content = item; + } }; // 添加导航 const add = () => { @@ -154,4 +221,19 @@ const reset_event = () => { width: 100%; height: 100%; } +.link-disabled { + background: #f5f5f5; + color: #999; + border-radius: 0px; +} +.card-background { + background: #fff; + padding-left: 1.6rem; + padding-right: 2rem; + border-radius: 4px; +} + +.cursor-move { + color: #ddd; +}