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

Can't use instance method as a v-for key when using v-memo #12013

Open
roysanchez opened this issue Sep 23, 2024 · 0 comments · May be fixed by #12014
Open

Can't use instance method as a v-for key when using v-memo #12013

roysanchez opened this issue Sep 23, 2024 · 0 comments · May be fixed by #12014
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. has workaround A workaround has been found to avoid the problem scope: compiler

Comments

@roysanchez
Copy link

Vue version

3.5.8

Link to minimal reproduction

https://play.vuejs.org/#eNqVVW1P2zAQ/iuWhQRIbSpgk6asrQYbH5gmNg2+LWgN8bUNJHZkO1lRlf++s50XB9pK5JPv/bnnzs6WXhZFUJVAQzpViUwLTRTosphHPM0LITW5jx8zIEspcnIcTKxkAo4/R3w6cSHojIKGvMhiDSgRMnVhExSmk85CR1SrRPBlugqelOBYdWu8I5qIvEgzkD8LnQquIhoSazG2OMvEv+9Wp2UJo1afrCF53qF/Uhuji+gvCQpkBRHtbDqWK9DOfH13Cxs8d8ZcsDJD7wPG36BEVhqMzu2q5Axhe34W7Y3lLuWre3W90cBV25QBajxr6x9RZPLrgdZ7uBfBBxsX8RpZ7MbQzw2Zho2dGINlXGbaZeFxDgaojWhgFlIUylbpodipn5wOdCzWsVUZMBIdJG+hEaJNwm/oEZI/rY70ZvOlLCRnDTHu69CA0uSsY819GWgN0pgvI9obHJY96c/3pz/fm/5qkL49PnTezhMZ8hqzoEbD4Ad3qPEqtDBz0GvBVNgATdYxX8EPm+/E0DlqkresogvOXOAwM7E6WRxtjVNg+qjHjeACajIjR9vmvDhtoz0PdHAHC6fnDRfIA/D+wovTJmG3A571ba0b9t46KdtXI2Vt/nb37Utz4NmxW2mPRlhDzBrBiLI7W+P8FlHg67R+pXZs7TDcQQaJJjvsKLTJjb4vO9WPgr34GEg1Xgo5i6jpkIhlf5EiSsJneEGTRyMqq3EOuXBqf5IRHeBj8+3W0WbYJXWNSPruO49XSXb7+fdmqlzbJiuCcHNHWCnzpS9u1VG1Y+ePoAKuA/eaBVWclTBEb+sI+wB2/DRbjQw199HwY2P9uqFDBwbM4DLM2uuAhbDtRm26dXWGPU5cGp8Gn5XhfLuR4rnZt+FP7m+FcLEGvs4XwcfgE63/A0QlRvw=

Steps to reproduce

In the SFC change the value of any of the dropdowns.

What is expected?

It should change the value of the dropdown.

What is actually happening?

It's crashing.

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
    Memory: 10.56 GB / 31.71 GB
  Binaries:
    Node: 20.12.2 - C:\Program Files\nodejs\node.EXE
    npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 128.0.6613.138
    Edge: Chromium (128.0.2739.79)
    Internet Explorer: 11.0.19041.4355
  npmPackages:
    vue: ^3.4.21 => 3.4.21

Any additional comments?

When compiling, the v-memo cache key comparison should use $options instead of the data parameter.

You can sidestep the issue by adding this to the :key property. Like :key=this.getId(data).

@edison1105 edison1105 added scope: compiler has workaround A workaround has been found to avoid the problem 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. labels Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. has workaround A workaround has been found to avoid the problem scope: compiler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants