在 Vuejs 中,当我单击“X”时,我必须删除一个部分。但有一些错误

发布于 2025-01-14 16:35:52 字数 323 浏览 0 评论 0原文

控制台上出现错误的输出图像

在此处输入图像描述

这是显示错误的代码图片

<图片src="https://i.sstatic.net/pgxVr.png" alt="在此处输入图像描述">

image of output with error on console

enter image description here

heres the picture of code where its showing error

enter image description here

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

若无相欠,怎会相见 2025-01-21 16:35:52

您的代码中既没有名为 tab 的属性,也没有名为 Index 的属性
定义数据部分并添加这些属性

data() {
 return {
  tab: null,
  Index: null
 }
}

此外,除了 console.log 中之外,我没有看到这些变量的任何用法。
因此,如果这是真的,则无需定义 data() 部分。您可以直接发出参数,例如

methods: {
  removeSection(idx) {
   this.$emit('remove', idx);
  }
}

There is neither an attribute called tab nor Index in your code
Define a data section and add those attributes

data() {
 return {
  tab: null,
  Index: null
 }
}

Also I don't see any usage of those variables other than in console.log.
So if that's true then no need define the data() section. You can directly emit the parameter like

methods: {
  removeSection(idx) {
   this.$emit('remove', idx);
  }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文