I am trying to link pages together in my Vue application and it is not displaying anything.
I am not using vue-router but a a method in which I define my pages in a vue.config.js in my project folder. My pages sit under src/pages/'page name' and inside that sits a app.vue and also a main.js. Refer to the below for screenshots.
When navigating to a page i have defined, the title appears correctly but nothing is displayed. I have a complete blank page.
I am seeking help as to why this is happening. Thank you in advance!
Here are 2 screenshots of things i think are important.
This is my App.vue located in src/pages/HomePage/App.vue
<template>
<div id="app">
<img
alt="Vue logo"
src="@/assets/logo.png"
>
<div style="position: relative">
<div class="short-it">
</div>
<div />
</div>
<nav>
<ul>
<li>Go to</li>
<li>
<a
href="about.html"
>
About Us
</a>
</li>
</ul>
</nav>
</div>
</template>
<script>
export default {
}
</script>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
.short-it {
position: relative;
overflow-x: hidden;
overflow-y: auto;
max-height: 300px;
}
nav ul {
margin-top: 30px
}
</style>
This is my main.js located in src/pages/HomePage/main.js
import Vue from 'vue'
import App from './App.vue'
Vue.config.productionTip = false
new Vue({
render: h => h(App)
}).$mount('#app')
Below are further screenshots and snippets of files that i thought i might just include.
This is Jsconfig.json file located in jsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"baseUrl": "./",
"moduleResolution": "node",
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
}
}
Below is my package.json located in package.json
{
"name": "brayden-dk",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.8.3",
"html-webpack-plugin": "^5.5.0",
"sass-loader": "^13.0.2",
"scss-loader": "^0.0.1",
"vue": "^3.2.13"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "@babel/eslint-parser"
},
"rules": {
"vue/multi-word-component-names": "off"
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead",
"not ie 11"
]
}