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

Null values are printed as null #41

Closed
reinerBa opened this issue Mar 23, 2018 · 1 comment
Closed

Null values are printed as null #41

reinerBa opened this issue Mar 23, 2018 · 1 comment

Comments

@reinerBa
Copy link

reinerBa commented Mar 23, 2018

I am wondering why null is interpreted as the string value "null"

jsonData = [
  {
    "Name1":  "John",
    "Name2": null
  },
  {
    "Name1":  "Doo",
    "Name2": null
  }
]

Results in the excel file
unbekannt

I did a workaround but this shouldn't be the final solution right?

    computed: {
      json_data () {
          return this.jsonData.map(e => {
              let tmp = {}
              for (let k in e) {
                  tmp[k] = e[k] === null ? '' : e [k]
              }
              return tmp
          })
      }
    }
@jecovier
Copy link
Owner

Hi @reinerBa sorry for the super late response, now by default all the undefined or null values are converted to blank space. There is a new prop called default-value that allows you to set a fallback value when the data is undefined or null.

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

No branches or pull requests

2 participants