1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<template> <router-view></router-view> </template> <script> export default { name: 'App', beforeMount: function() { // importing server data into the store const serverDataElmt = document.getElementById('serverData'); if (serverDataElmt !== null) { this.$store.commit('setServerData', JSON.parse(document.getElementById('serverData').dataset.server)); } } } </script>