-
-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
fix(components): [table] getColumnIndex
may be undefned
#16782
Conversation
Fix table column getColumnIndex undefined bug
👋 @406087475, seems like this is your first time contribution to element-plus.
|
Hello @406087475, thank you for contributing to element-plus, please see our guideline to see how to make contribution |
Thank you for your contribution, but it is duplicated with #16781. |
Can you provide a use case scenario where the error occurs? |
I will close my PR |
Hi, Is this issue still being progressed? |
@ttionya Hi, can you provide a reproducible example? We have not encountered the corresponding scenario. |
@btea , Before providing reproducible code, I would like to confirm a syntax first. I have a scenario where I use <el-table-column ... v-if="condition" />
<el-table-column ... v-else /> |
According to the example you provided, you are displaying two different columns under two different conditions? |
Yes, and this |
This is fine if the corresponding fields are different. If it is the same field, and different content is rendered under different conditions, then you can render it according to the condition in the |
Thank you for your quick response. Perhaps indeed there is an issue with my syntax, the <el-table-column prop="notname" v-if="condition"> <!-- prop is not name -->
<template v-slot="{ row }">
<el-link>{{ row.name }}</el-link> <!-- use row.name -->
</template>
</el-table-column>
<el-table-column prop="name" v-else /> |
I tested a simple example and it is normal. link |
Yes, this is not an error that would occur in a simple scenario, otherwise others would have reported it already. :) Briefly describe the reproduction method, if necessary, I can create a reproducible code example. The specific scenario is that when keepalive is used and it is in an inactive state, the |
Oh, it seems a bit complicated according to your description. If you have time, please create a repository and provide the simplest reproducible code. Thanks! |
@btea Hi, https://github.com/ttionya/element-plus-table-error-repro is a simple example to reproduce the issue. I am happy to discuss any questions. Looking forward to the issue being resolved. |
@ttionya Thanks! |
🧪 Playground Preview: https://element-plus.run/?pr=16782 |
getColumnIndex
may be undefned
这个 |
Fix table column getColumnIndex undefined bug
Please make sure these boxes are checked before submitting your PR, thank you!
dev
branch.