"Router-link in Vue is unresponsive and unclickable - seeking

After making changes to the vue.config.js file, updating the host parameter to web-dev.test.ru in order to work with a public network, we encountered an issue where external network links still led to localhost

The routes stopped working and were no longer clickable

The Menu component contains elements where the routes are assigned

<nav  class="flex-grow md:block px-4 pb-4 md:pb-0 md:overflow-y-auto">
            <router-link  v-for="m in menu" :key="menu.id"  class="block px-4 py-2 mt-2 text-sm font-semibold text-gray-900 dark-mode:bg-gray-700 dark-mode:hover:bg-gray-600 dark-mode:focus:bg-gray-600 dark-mode:focus:text-white dark-mode:hover:text-white dark-mode:text-gray-200 hover:text-gray-900 focus:text-gray-900 hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline"
                 :to="m.url"> {{m.name}} <IconComponent style="float: right" :width="16" :height="16" :iconsvg="ic(m.icon)"></IconComponent></router-link>
          </nav>
        </div>    
    </template>
    <script lang="ts">
    import { defineComponent, PropType,  } from "vue";
    import { UsersInterface } from "@/models/interfaces/Users.interface";
    import menu from "../../../public/static/data/menu.json"
    import IconComponent from "@/components/icons/Icons.component.vue";
    import RootState from "@/store/root"
    
    export default defineComponent({
      components: {
                IconComponent
      },
      props: {
       
      },
    emits: ['selectmenu'],
      setup(props, {emit}) {
    
        const onUserSelect = (user: UsersInterface) => {
          user.selected = !user.selected;
        //  console.log("onUserSelect", user.IDuser, user.selected);
          emit('selectmenu', user)
        };
    
        const ic = (icon: string) => {
          console.log("onloadicons getters");
          return RootState.getters["iconStore/getSvg"]({ Nameicon: icon });
        };
    
        return {
          onUserSelect,
          menu,
          ic
        };
      },
    });

File - vue.config.js

module.exports = {
    devServer: {
        proxy: 'http://localhost:89/',
        host: 'web-dev.test.ru',
        port: '8080',
        public: 'http://web-dev.test.ru:8080',
        disableHostCheck: true,
        overlay: {
            warnings: true,
            errors: true
        }
        
    },
    configureWebpack: {
        devtool: 'source-map'
    }
}

File containing routes for my application

import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import Home from '../views/Home.vue'
import Auth from '../views/Auth.vue'
import RootState from '../store/root'
import Inbox from '../views/Inbox.vue'
import Outbox from '../views/Outbox.vue'
import Load from '../views/Load.vue'

const routes: Array<RouteRecordRaw> = [

  {
    path: '/auth',
    name: 'Auth',
    component: Auth,
  },

  {
    path: '/main',
    name: 'Home',
    component: Home
  },



  {
    path: '/inbox',
    name: 'Inbox',
    component: Inbox

  },

  {
    path: '/outbox',
    name: 'Outbox',
    component: Outbox


  }
]



const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router

Main.ts file

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import RootState from './store/root'

import './index.css'
//sync(RootStore, router) 
createApp(App).use(RootState).use(router).mount('#app')

Answer №1

Upon instructions, I checked out the

<router-view></router-view>
tag within the main file of my application, located in the App.vue file.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What steps can be taken to turn off the ETag feature in npm's express during configuration?

I am a beginner in using nodejs and npm. I have been given the task of disabling Etag generation in the configuration level of npm express. The answer I found is to use app.set('etag', false); // turn off but I am looking for similar solutions on ...

Separate an array in TypeScript based on the sign of each number, and then replace the empty spaces with null objects

Hey, I'm facing a little issue, I have an Array of objects and my goal is to split them based on the sign of numbers. The objects should then be dynamically stored in different Arrays while retaining their index and getting padded with zeros at the b ...

Issue "unableToRollbackOptional" encountered when using create-react-app

Currently delving into the world of React and encountering a few obstacles. Below are screenshots of the two errors I encountered while running: npm i -g <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2a49584f4b5e4f07584f4b495 ...

Issue with setting cookies in Node.js using Express

Recently I made the switch from regular JavaScript to TypeScript for my project. Everything seems to be functioning properly, except for session handling. This is the current setup of my project: Server.ts App.ts /db/mongo/MongoHandler.ts and some other ...

issue encountered while using npm to install aframe

Having some trouble installing aframe and aframe-inspector for local development. I've tried various methods, but keep encountering errors during npm install or npm start. When attempting to install aframe, I encounter an error during npm install. For ...

Accessing an external API through a tRPC endpoint (tRPC Promise is resolved before processing is complete)

I want to utilize OpenAI's API within my Next.js + tRPC application. It appears that my front-end is proceeding without waiting for the back-end to finish the API request, resulting in an error due to the response still being undefined. Below is my e ...

Using Typescript for the factory design pattern

My goal is to develop a factory for generating instances of MainType. To achieve this, I want to reuse existing types (specifically the same instance) which are stored in the ItemFactory. class BaseType { } class MainType extends BaseType { } class It ...

Troubleshooting scope variable issues with the ngStyle binding in Angular

Below is the code snippet for a component I have: @Component({ template: ` <div class="container"> <div *ngFor="let connection of connections"> <div class="row"> <div class='col-2'>{{connection.arriv ...

Error encountered in typescript when trying to implement the Material UI theme.palette.type

Just starting out with Material UI and TypeScript, any tips for a newcomer like me? P.S. I'm sorry if my question formatting isn't quite right, this is my first time on Stack Overflow. https://i.stack.imgur.com/CIOEl.jpg https://i.stack.imgur.co ...

What are the best Gulp and Sass packages available on NPM?

Sorry if this question seems silly. I have been learning about NPM through a tutorial, specifically focusing on package management. The tutorial instructs me to choose a package from the NPM website and install it using the command: npm install <packag ...

Error message: "SyntaxError: Unexpected token import was not caught by the foundation"

I have recently taken over development from a previous developer who integrated Zurb Foundation as a framework into our website. The Foundation framework was installed using npm. I am encountering errors in the console related to all of the foundation java ...

What potential drawbacks could arise from adding an npm dependency only when needed rather than as an optional dependency?

Is there any potential downside to adding a package whenever it is needed in my code rather than listing it as an optional dependency in the package.json file? this.install('test-package'); As opposed to including it in package.json like this: & ...

The sequence of output in TypeScript when using Gulp is similar to running tsc with a tsconfig

After setting up a tsconfig file and successfully running the command-line tsc, I encountered an issue when using gulp-typescript with a tsconfig.json and outFile specified. The output ordering was different, and I have been unable to find a solution in Gu ...

Sharing data between Vue.js v2 components and updating the parent when it's modified

My goal is to create a Form that can identify errors in its Inputs. Despite hours of effort, my current setup, which renders the inputs within a section of the form, is not functioning as intended. What would be the most effective approach to ensure this ...

Properties undefined

All of my functions are giving errors indicating that the props are not defined. The error specifically relates to the word "props" in the following functions: function PostButton(props) function PostButton2(props) function TotalVotes(props) ...

Specialized typescript function that is compatible with extended interfaces

Is there a way to create a versatile function that can be applied to any interface derived from a top-level interface? This function should take an unpersisted interface (without an id property) and return a persisted one (with an id property). The two ma ...

The combination of html2canvas and jsPDF does not function properly in a Vue CLI application

I'm currently facing an issue while trying to implement jsPDF and html2canvas into my Vue CLI application. Unfortunately, it seems like the integration is not working as expected. I came across a tutorial online that served as an inspiration for me, b ...

No types are assigned to any props

I recently began working on a SvelteKit skeleton project for my personal website. However, I encountered an error when using Svelte with TypeScript - specifically, I kept getting the message Type '<some prop type>' is not assignable to type ...

Launching the MEAN stack application into production

After completing a web app at an enterprise level, utilizing Vue for the front end, Node for the backend, and MongoDB as the database, we faced the challenge of hosting them separately during development. However, this setup may not be suitable for product ...

Searching for a specific row of data by ID in a massive CSV file using Node.js

Can someone recommend an npm package that is ideal for iterating over a csv file, locating a specific value, and updating/appending to that particular row? I don't have any code to display at the moment as I'm in the process of testing different ...