I need your help to implement the Moralis NPM package in Vuejs. Because when I try to use it I get the error
“Module parse failed: Shorthand property assignments are valid only in destructuring patterns.” In line 25.
In HTML code
<button class="btn" @click="login">Login</button>
Script code
import Moralis from 'moralis';
export default {
name: 'StartButton',
mounted() {
Moralis.initialize('zva1Qvb0g3fqqiM2TK447IOkJ0NozUbOMtFi5pxZ');
Moralis.serverURL = 'https://anlwkd9xpyam.usemoralis.com:2053/server';
const init = async () => {
window.web3 = await Moralis.Web3.enable();
};
init();
},
methods: {
login = async () => { //This is line 25
try {
const user = await Moralis.Web3.authenticate();
} catch (error) {
const code = error.code;
const message = error.message;
}
}
},