tdesign-vue-next
Version:
TDesign Component for vue-next
1 lines • 1.01 kB
Source Map (JSON)
{"version":3,"file":"useDestroyOnClose.mjs","sources":["../../../components/hooks/useDestroyOnClose.ts"],"sourcesContent":["import { ref, provide, onUpdated } from 'vue';\n\nexport const TDisplayNoneElementRefresh = 't-display-none-element-refresh';\n\n// destroyOnClose=false 时,父元素为 display: none,此时的子元素无法获取到自身元素的任何宽度\n// 因此,需在父元素 display: none 发生变化时主动更新子元素\nexport default function useDestroyOnClose() {\n const refresh = ref(0);\n provide(TDisplayNoneElementRefresh, refresh);\n onUpdated(() => {\n refresh.value += 1;\n });\n}\n"],"names":["TDisplayNoneElementRefresh","useDestroyOnClose","refresh","ref","provide","onUpdated","value"],"mappings":";;;;;;;;AAEO,IAAMA,0BAA6B,GAAA,iCAAA;AAI1C,SAAwBC,iBAAoBA,GAAA;AACpC,EAAA,IAAAC,OAAA,GAAUC,IAAI,CAAC,CAAA,CAAA;AACrBC,EAAAA,OAAA,CAAQJ,4BAA4BE,OAAO,CAAA,CAAA;AAC3CG,EAAAA,SAAA,CAAU,YAAM;IACdH,OAAA,CAAQI,KAAS,IAAA,CAAA,CAAA;AACnB,GAAC,CAAA,CAAA;AACH;;;;"}