Skip to content

Commit ca6bfcf

Browse files
committed
fix(n-upload): default slot non-function value encountered warning
1 parent abea5be commit ca6bfcf

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

CHANGELOG.en-US.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# CHANGELOG
22

3+
## NEXT_VERSION
4+
5+
`NEXT_VERSION`
6+
7+
### Fixes
8+
9+
- Fix `n-upload` default slot non-function value encountered warning.
10+
311
## 2.41.0
412

513
`2025-01-05`

CHANGELOG.zh-CN.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# CHANGELOG
22

3+
## NEXT_VERSION
4+
5+
`NEXT_VERSION`
6+
7+
### Fixes
8+
9+
- 修复 `n-upload` 默认插槽非函数的警告问题
10+
311
## 2.41.0
412

513
`2025-01-05`
@@ -2957,7 +2965,7 @@
29572965
### Fixes
29582966

29592967
- 修复 `n-date-picker` `n-provider` 传递 `date-locale` 属性无效,关闭 [#250](https://github.com/tusen-ai/naive-ui/issues/250)
2960-
- 修复 `n-input` clear button placeholder prevent clicking on actual component [#288](https://github.com/tusen-ai/naive-ui/issues/288)
2968+
- Fix `n-input` clear button placeholder prevent clicking on actual component [#288](https://github.com/tusen-ai/naive-ui/issues/288)
29612969
- 修复 `n-carousel` 点击当前页对应的控制按钮时,组件显示异常
29622970
- 修复 `n-menu` 折叠时 `render-label` 对于 tooltip 不生效
29632971
- 修复 `n-dropdown` 不能在选项中渲染 `n-popover`

src/upload/src/UploadFile.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,11 @@ export default defineComponent({
265265
renderIcon(file)
266266
) : isImageFile(file) ? (
267267
<NBaseIcon clsPrefix={clsPrefix}>
268-
{{ default: renderImageIcon }}
268+
{{ default: () => renderImageIcon }}
269269
</NBaseIcon>
270270
) : (
271271
<NBaseIcon clsPrefix={clsPrefix}>
272-
{{ default: renderDocumentIcon }}
272+
{{ default: () => renderDocumentIcon }}
273273
</NBaseIcon>
274274
)}
275275
</span>

0 commit comments

Comments
 (0)