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

Doesn't render if DescItem#show is set as "() => false" #252

Closed
JohnNiang opened this issue Feb 7, 2021 · 0 comments · Fixed by #253
Closed

Doesn't render if DescItem#show is set as "() => false" #252

JohnNiang opened this issue Feb 7, 2021 · 0 comments · Fixed by #253

Comments

@JohnNiang
Copy link
Contributor

Subject of the issue

Doesn't render if DescItem#show is set as () => false. And raise errors and warnings as below:

runtime.js:268 Uncaught (in promise) TypeError: Cannot read property 'type' of null
    at isEmptyElement (runtime.js:268)
    at runtime.js:293
    at Array.filter (<anonymous>)
    at filterEmpty (runtime.js:291)
    at getRows (index.js:22)
    at Proxy.<anonymous> (warning.js:1)
    at renderComponentRoot (reactivity.esm-bundler.js:630)
    at componentEffect (runtime-core.esm-bundler.js:4974)
    at reactiveEffect (shared.esm-bundler.js:161)
    at effect (shared.esm-bundler.js:27)

Your environment

  • OS: 5.10.7-3-MANJARO
  • Packages: 2.0.0-rc.18
  • Env: node v14.15.4

Steps to reproduce

Tell us how to reproduce this issue. Please provide a working and simplified example.

🎉 BONUS POINTS for creating a minimal reproduction and uploading it to GitHub. This will get you the fastest support. 🎉

  • useDescription
  • setSchema
      const [register] = useDescription({
        column: 2,
        schema: [ {
            field: 'test',
            label: 'test',
            show: () => false,
          },
        ]
      });

Expected behaviour

What should happen?

Nothing to show.

Actual behaviour

What happens instead?

Prevent other components from rendering due to errors.

JohnNiang added a commit to JohnNiang/vue-vben-admin that referenced this issue Feb 7, 2021
anncwb pushed a commit that referenced this issue Feb 7, 2021
* fix(description): not rendering while show method return false

fix #252

* Move data desctruction outside loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant