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

Values set as false disappear #47

Closed
alxgrepe opened this issue Jun 15, 2021 · 2 comments · Fixed by #48
Closed

Values set as false disappear #47

alxgrepe opened this issue Jun 15, 2021 · 2 comments · Fixed by #48

Comments

@alxgrepe
Copy link

When setting one of the metadata fields to false, they disappear completely from the $route.meta .

File test.vue:

<template>
<code>
isTrue: {{ this.$route.meta.isTrue }}
isFalse: {{ this.$route.meta.isFalse }}
isOther: {{ this.$route.meta.isOther }}
isAlsoTrue: {{ this.$route.meta.isAlsoTrue }}
isAlsoFalse: {{ this.$route.meta.isAlsoFalse }}
</code>
</template>

<script>
export default {
  isTrue: true,
  isFalse: false,
  isOther: 'other',
  meta: {
    isAlsoTrue: true,
    isAlsoFalse: false,
  },
}
</script>

<style scoped>
code {  white-space: pre-wrap; }
</style>

Output:

  isTrue: true
  isFalse: 
  isOther: other
  isAlsoTrue: true
  isAlsoFalse: 

(I'm using v2.0.6 and nuxt v2.15.3.)

@dword-design dword-design linked a pull request Jun 15, 2021 that will close this issue
@dword-design
Copy link
Owner

@alxgrepe Thanks for discovering this issue! Should be fixed by running npm update or yarn upgrade. Reason was a bug in ast-to-literal.

@alxgrepe
Copy link
Author

Awesome @dword-design, thanks for the quick fix - I can confirm that it works perfectly now!

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.

2 participants