So I had never used Vue.js before, after I learned some basic concepts I created a new project via the Vue CLI. I've been working on it and received different errors (I still have a lot to learn) so I looked up a way to debug easily.
I'm using WebStorm as IDE and Chrome as browser. I added the Vue.js devtools extension to Chrome, ran the project through npm run serve
and opened up the devtool console.
The extension says Vue is detected on the page but the Vue window doesn't show up.
- Chrome is at its the latest version
- I removed other extensions like AdBlocker
- reloaded the page
- closed and restarted the browser and later on also the computer
I then found this other extension: https://chrome.google.com/webstore/detail/vuejs-devtools/ljjemllljcmogpfapbkkighbhhppjdbg removed the first one, added this and did the same things.
Still doesn't work. Should I add something to my code maybe?
Index.html
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
main.js
import { createApp } from 'vue'
import App from './App.vue'
createApp(App).mount('#app')
App.vue
<template>
<div class="container">
<div id="imag_container">
<img src="./assets/logo.png" alt="logo ITIS">
</div>
<KioskParagraphSlider id="slider"/>
<EventsCalendar id="calendar"/>
</div>
</template>
<script>
import KioskParagraphSlider from './components/KioskParagraphSlider.vue'
import EventsCalendar from './components/EventsCalendar.vue'
export default {
name: 'App',
components: {
KioskParagraphSlider, EventsCalendar
}
}
</script>
<style>
body{
margin: 0;
}
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
}
.container{
display: grid;
grid-template-columns: 1fr 4fr;
grid-template-rows: 3fr 7fr;
}
#calendar{
grid-column-start: 1;
grid-column-start: 3;
}
</style>
package.json
{
"name": "kiosk",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"core-js": "^3.8.3",
"vue": "^3.2.13"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-service": "~5.0.0"
}
}
Obviously there are many other files.
Hope any of you can help me.