Skip to content

Conditonally rendering columns in DataTable with v-if is throwing error #719

Closed
@redsuperbat

Description

@redsuperbat
<Column
:sortable="true"
headerClass="md:w-28"
field="volume"
header="Volym"
v-if="!sm"
/>

sm is just a boolean that checks the screenwidth. I want to conditionally render columns but it throws the error below.

nonIterableSpread.js:2 Uncaught (in promise) TypeError: Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.
    at _nonIterableSpread (nonIterableSpread.js:2)
    at _toConsumableArray (toConsumableArray.js:6)
    at DataTable.vue:1669
    at Array.forEach (<anonymous>)
    at Proxy.columns (DataTable.vue:1667)
    at ComputedRefImpl.reactiveEffect [as effect] (reactivity.esm-bundler.js:42)
    at ComputedRefImpl.get value [as value] (reactivity.esm-bundler.js:827)
    at Object.get [as columns] (runtime-core.esm-bundler.js:5622)
    at Proxy.render (DataTable.vue:21)
    at renderComponentRoot (runtime-core.esm-bundler.js:705)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type: BugIssue contains a bug related to a specific component. Something about the component is not working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions