Commit bb8c2dea40566d17d3de37761bed4cd14845299d
Committed by
GitHub
1 parent
dce3aba2
fix: 解决IconPicker初始拷贝了value的值,导致剪切板内容被覆盖 (#2591)
Showing
1 changed file
with
10 additions
and
1 deletions
src/components/Icon/src/IconPicker.vue
... | ... | @@ -124,7 +124,16 @@ |
124 | 124 | const { prefixCls } = useDesign('icon-picker'); |
125 | 125 | |
126 | 126 | const debounceHandleSearchChange = useDebounceFn(handleSearchChange, 100); |
127 | - const { clipboardRef, isSuccessRef } = useCopyToClipboard(props.value); | |
127 | + | |
128 | + let clipboardRef; | |
129 | + let isSuccessRef; | |
130 | + | |
131 | + if (props.copy) { | |
132 | + const clipboard = useCopyToClipboard(props.value); | |
133 | + clipboardRef = clipboard?.clipboardRef; | |
134 | + isSuccessRef = clipboard?.isSuccessRef; | |
135 | + } | |
136 | + | |
128 | 137 | const { createMessage } = useMessage(); |
129 | 138 | |
130 | 139 | const { getPaginationList, getTotal, setCurrentPage } = usePagination( | ... | ... |