mirror of
				https://github.com/Tencent/tmagic-editor.git
				synced 2025-11-04 10:49:51 +08:00 
			
		
		
		
	fix(form): group-list默认展开
This commit is contained in:
		
							parent
							
								
									9716aceabf
								
							
						
					
					
						commit
						8ca6b3fbe4
					
				@ -25,7 +25,7 @@
 | 
				
			|||||||
      @addDiffCount="onAddDiffCount()"
 | 
					      @addDiffCount="onAddDiffCount()"
 | 
				
			||||||
    ></MFieldsGroupListItem>
 | 
					    ></MFieldsGroupListItem>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <TMagicButton @click="addHandler" size="small" :disabled="disabled" v-if="addable">添加组</TMagicButton>
 | 
					    <TMagicButton @click="addHandler" size="small" :disabled="disabled" v-if="addable">新增</TMagicButton>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <TMagicButton :icon="Grid" size="small" @click="toggleMode" v-if="config.enableToggleMode">切换为表格</TMagicButton>
 | 
					    <TMagicButton :icon="Grid" size="small" @click="toggleMode" v-if="config.enableToggleMode">切换为表格</TMagicButton>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
 | 
				
			|||||||
@ -43,7 +43,7 @@
 | 
				
			|||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script setup lang="ts">
 | 
					<script setup lang="ts">
 | 
				
			||||||
import { computed, inject, ref, watchEffect } from 'vue';
 | 
					import { computed, inject, ref } from 'vue';
 | 
				
			||||||
import { CaretBottom, CaretRight, CaretTop, Delete } from '@element-plus/icons-vue';
 | 
					import { CaretBottom, CaretRight, CaretTop, Delete } from '@element-plus/icons-vue';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import { TMagicButton, TMagicIcon } from '@tmagic/design';
 | 
					import { TMagicButton, TMagicIcon } from '@tmagic/design';
 | 
				
			||||||
@ -73,11 +73,7 @@ const props = defineProps<{
 | 
				
			|||||||
const emit = defineEmits(['swap-item', 'remove-item', 'change', 'addDiffCount']);
 | 
					const emit = defineEmits(['swap-item', 'remove-item', 'change', 'addDiffCount']);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const mForm = inject<FormState | undefined>('mForm');
 | 
					const mForm = inject<FormState | undefined>('mForm');
 | 
				
			||||||
const expand = ref(false);
 | 
					const expand = ref(props.config.expandAll || !props.index);
 | 
				
			||||||
 | 
					 | 
				
			||||||
watchEffect(() => {
 | 
					 | 
				
			||||||
  expand.value = props.config.expandAll || !props.index;
 | 
					 | 
				
			||||||
});
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
const rowConfig = computed(() => ({
 | 
					const rowConfig = computed(() => ({
 | 
				
			||||||
  type: 'row',
 | 
					  type: 'row',
 | 
				
			||||||
 | 
				
			|||||||
@ -122,7 +122,7 @@
 | 
				
			|||||||
      </TMagicTooltip>
 | 
					      </TMagicTooltip>
 | 
				
			||||||
      <slot></slot>
 | 
					      <slot></slot>
 | 
				
			||||||
      <TMagicButton v-if="addable" size="small" type="primary" :disabled="disabled" plain @click="newHandler()"
 | 
					      <TMagicButton v-if="addable" size="small" type="primary" :disabled="disabled" plain @click="newHandler()"
 | 
				
			||||||
        >添加</TMagicButton
 | 
					        >新增一行</TMagicButton
 | 
				
			||||||
      >
 | 
					      >
 | 
				
			||||||
       
 | 
					       
 | 
				
			||||||
      <TMagicButton
 | 
					      <TMagicButton
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user