I am getting this error when trying to scramble a word in vue.js using "shuffle" from the lodash library. This is the code that is causing the issue.
import { shuffle } from 'lodash'
// Get word of the day
const answer = getWordOfTheDay();
// scramble word of the day
export default {
data() {
return {
word: answer,
scrambledWord: ''
}
},
methods: {
scrambleWord(word) {
return shuffle(word.split('')).join('')
}
}
}
I tried moving the block of code around and changing the order of things but i still get the same error. highlighted on the the "export default" part.
In case someone is wondering, one of the most common reasons this happens is when the attribute "setup" is left in the script tag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With