为什么在使用Flicking软件包时发送此错误消息?

发布于 2025-01-25 09:40:30 字数 1353 浏览 5 评论 0原文

我正在使用 flicking软件包&闪烁的组件可以很好地创建旋转频率,但是每当我尝试移动(Flick)的一个儿童组件之一时,闪烁的组件会产生错误,如下所示。

Flicking.ts:58 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'key')
    at Flicking.ts:58:19
    at Array.map (<anonymous>)
    at getPanels (Flicking.ts:57:28)
    at normalizeChildren (runtime-core.esm-bundler.js:6408:42)
    at createBaseVNode (runtime-core.esm-bundler.js:6170:9)
    at _createVNode (runtime-core.esm-bundler.js:6263:12)
    at createVNodeWithArgsTransform (runtime-core.esm-bundler.js:6128:12)
    at h (runtime-core.esm-bundler.js:7479:16)
    at Proxy.render (Flicking.ts:192:8)
    at renderComponentRoot (runtime-core.esm-bundler.js:893:44)

我已经在VUE3 oplectpref上实现了以下代码

<Flicking class="px-3" :options="{ moveType: 'freeScroll', bound: true } ">
      <div @click="choosePref('1')>1</div>
      <div @click="choosePref('2')>2</div>
      <div @click="choosePref('3')>3</div>
      <div @click="choosePref('4')>4</div>
    </Flicking>

,该函数可以记录单击的DIV中的数字。

const choosePref = (num) =>{
console.log(num)
}

是我实施的问题还是软件包中有某种错误?您能解释一下错误以及如何解决错误吗?

I am using the Flicking package & the Flicking component is creating the carousel just fine but every time I try to move (flick) one of the child components an error is created by the Flicking component as follows.

Flicking.ts:58 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'key')
    at Flicking.ts:58:19
    at Array.map (<anonymous>)
    at getPanels (Flicking.ts:57:28)
    at normalizeChildren (runtime-core.esm-bundler.js:6408:42)
    at createBaseVNode (runtime-core.esm-bundler.js:6170:9)
    at _createVNode (runtime-core.esm-bundler.js:6263:12)
    at createVNodeWithArgsTransform (runtime-core.esm-bundler.js:6128:12)
    at h (runtime-core.esm-bundler.js:7479:16)
    at Proxy.render (Flicking.ts:192:8)
    at renderComponentRoot (runtime-core.esm-bundler.js:893:44)

I have implemented the following code on Vue3

<Flicking class="px-3" :options="{ moveType: 'freeScroll', bound: true } ">
      <div @click="choosePref('1')>1</div>
      <div @click="choosePref('2')>2</div>
      <div @click="choosePref('3')>3</div>
      <div @click="choosePref('4')>4</div>
    </Flicking>

choosePref is a function that logs out the number in the div that was clicked.

const choosePref = (num) =>{
console.log(num)
}

Is the issue in my way of implementing or is there some sort of bug in the package? and can you please explain what the error is about and how to fix it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文