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

Error using $q.screen.setSizes() #2469

Closed
shinynet opened this issue Aug 25, 2018 · 1 comment
Closed

Error using $q.screen.setSizes() #2469

shinynet opened this issue Aug 25, 2018 · 1 comment
Milestone

Comments

@shinynet
Copy link

Software version

Quasar: 0.17.10
OS: Linux(4.15.0-33-generic) - linux/x64
Node: 8.11.3
NPM: 5.6.0
Browsers: Chrome

Testing out the screen plugin and using the code from the doc to set breakpoint sizes

What did you get as the error?

vue.runtime.esm.js?2b0e:1737 TypeError: sizes.forEach is not a function
at Object.setSizes (screen.js?da89:62)
at VueComponent.mounted (App.vue?234e:12)
at callHook (vue.runtime.esm.js?2b0e:2917)
at Object.insert (vue.runtime.esm.js?2b0e:4154)
at invokeInsertHook (vue.runtime.esm.js?2b0e:5956)
at Vue.patch [as patch] (vue.runtime.esm.js?2b0e:6104)
at Vue._update (vue.runtime.esm.js?2b0e:2656)
at Vue.updateComponent (vue.runtime.esm.js?2b0e:2778)
at Watcher.get (vue.runtime.esm.js?2b0e:3138)
at new Watcher (vue.runtime.esm.js?2b0e:3127)

What were you expecting?

What steps did you take, to get the error?

  mounted() {
    this.$q.screen.setSizes({
      sm: 300,
      md: 500,
      lg: 1000,
      xl: 2000
    })
  }

Looking at the plugin code, I don't get why it's calling forEach(). It's being passed an Object, not an Array

this.setSizes = sizes => {
  sizes.forEach(name => {
    updateSizes[name] = sizes[name]
  })
}
@rstoenescu rstoenescu added this to the v0.17.11 milestone Aug 26, 2018
@rstoenescu
Copy link
Member

Thanks for reporting. Fixed it in future Quasar v0.17.11

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