Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marquee组件开发模式下有warning: Non-function value encountered for default slot. Prefer function slots for better performance. #6600

Open
5 tasks done
morrow-lw-dog opened this issue Dec 6, 2024 · 8 comments · May be fixed by #6706
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction

Comments

@morrow-lw-dog
Copy link

morrow-lw-dog commented Dec 6, 2024

描述错误

开发模式下,使用Marquee组件dev tool有warning

复现步骤

直接去看官网例子最基础的应用,点击在CodeSandbox中打开。然后在devtool里就能看到这样的报错:
[Vue warn]: Non-function value encountered for default slot. Prefer function slots for better performance.

image

或者在自己项目里随便哪个地方写一个最基础用法

Vue SFC

<template>
  <n-marquee>
    test
  </n-marquee>
</template>

TSX

import { NMarquee } from "naive-ui"

export default defineComponent(() => {
  return () => <NMarquee>test</NMarquee>
})

最小复现链接

https://codesandbox.io/s/lw4dtr

系统信息

System:
    OS: macOS 15.1.1
    CPU: (14) arm64 Apple M4 Pro
    Memory: 6.53 GB / 48.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.20.5 - ~/n/bin/node
    Yarn: 1.22.22 - ~/.yarn/bin/yarn
    npm: 10.8.2 - ~/n/bin/npm
    pnpm: 9.4.0 - ~/n/bin/pnpm
  Browsers:
    Chrome: 131.0.6778.109
    Safari: 18.1.1
  npmPackages:
    naive-ui: ~2.40.3 => 2.40.3 
    vue: ^3.4.27 => 3.4.27

使用的包管理器

yarn

验证

@morrow-lw-dog morrow-lw-dog added the untriaged need to sort label Dec 6, 2024
@morrow-lw-dog morrow-lw-dog changed the title Marquee组件有warning: Non-function value encountered for default slot. Prefer function slots for better performance. Marquee组件开发模式下有warning: Non-function value encountered for default slot. Prefer function slots for better performance. Dec 6, 2024
@Dobe-Gin
Copy link

同样的问题...

@zhangcz01
Copy link

同样问题。。。

@Flipped199
Copy link

原来是这个组件报的警告....

@642661520
Copy link

upload 组件同样会报错
image

@642661520
Copy link

upload 组件同样会报错 image

"naive-ui": "^2.40.4"

@jahnli jahnli added bug Something isn't working good reproduction ✨ This issue provides a good reproduction and removed untriaged need to sort labels Jan 1, 2025
@tx7do
Copy link

tx7do commented Jan 6, 2025

啊,是的,我升级到最新的版本,也还是有这个报错。但,好像功能没啥影响?

@noeGnh
Copy link

noeGnh commented Jan 10, 2025

+1

@suruibuas
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants