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 · 2 comments
Labels
untriaged need to sort

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

同样问题。。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged need to sort
Projects
None yet
Development

No branches or pull requests

3 participants