EL-Table with scoped slots running function twice

<el-table
ref="multipleTableRef"
:data="processingData.data.data"

table-layout="auto"
>
<el-table-column
type="selection"
width="50"
>
</el-table-column>

<!-- :fixed="(itemIn.type == 'editButton') ? 'right' : null" -->
<el-table-column v-for="itemIn in JSON.parse(processingData.structure.columns)" :key="itemIn.title"
:prop="itemIn.field"
:label="itemIn.title"
:align="itemIn.align"
:width="itemIn.width"
>

<template #default="scope">
<template v-if="itemIn.type == 'text'">
{{ testtest('hello') }}
</template>
</el-table-column>
</el-table>

It is running testtest 6 times (It duplicates the function call twice). It should be 3 times, as we have in total 3 rows, which each itemIn.type == 'text'. How is this possible?

Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)

Hi,

From the first look, your table component looks fine, it is hard to tell what is a problem without debugging.

Does your testtest function returns anything?

Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(