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

[Vue warn]: Invalid value for option "timers": expected an Object, but got Array. #55

Open
Zhangzijing opened this issue Oct 10, 2019 · 3 comments

Comments

@Zhangzijing
Copy link

mycode:

<template>
</template>

<script>

import { timer } from 'vue-timers'
 
export default {
  timers: [
    timer('log', 1000)
  ],
  methods: {
    log () {
      console.log('It works!')
    }
  }
}
</script>
@Zhangzijing
Copy link
Author

main.js:

import VueTimers from 'vue-timers' 
Vue.use(VueTimers)

@masongzhi
Copy link
Contributor

export default function install(Vue) {
  // this code will cause the warning report above
  Vue.config.optionMergeStrategies.timers = Vue.config.optionMergeStrategies.methods
  Vue.mixin(VueTimers)
}

@Kelin2025 I do not know what's mean and how to resolve it.

@stevegroner
Copy link

stevegroner commented Jun 10, 2020

Any word on this. I am getting the same thing when using an array for the timers var instead of a standard object. Per the docs an array is acceptable.

Invalid value for option "timers": expected an Object, but got Array.

timers: [ { name: 'log', time: 10000, autostart: true, repeat: true, immediate: true}, { name: 'sample', time: 5000, autostart: false, repeat: true, immediate: true} ],

Can you provide instructions on how to fix it.

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

3 participants