Is there an advantage to displaying my components in Vue and Vue Router in a production environment?

When deploying a Laravel and Vue application using Vue Router, the components are not mounting on my div with id app. What could be causing this issue?

The application is hosted on a shared hosting server, with the Laravel application located in a project folder.

I have defined the variables APP_URL and ASSET_URL to be mydomain.com/project/

In the Vue Router routes, the starting point is set as /admin

const routes = [    
{
  path: '/admin',
 children: [
     ...]

Vue.use(VueRouter);
const router = new VueRouter({
    mode: 'history',
    routes
})

The index file within the public folder appears to be fine. Initially, the login page displays correctly, user validation works, but upon logging in from the backend, redirection to the admin path where the Vue Router should act does not occur.

I have tried various approaches, including starting the path with / in my Vue Router routes, without success.

No errors are being displayed in the console or Laravel logs

Edit

new Vue({
    el: '#app',
    store,
    router,
    render: h => h(App)
});

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

It is important for Vue's @change event to keep the database

I need assistance with my todolist project. I want to create a checkbox that can update a property in Vue and my database. The checkbox should set the active status to true when checked and false when unchecked. In the Vue HTML, the v-model should be used ...

Ajax insertion was successful, but the database records are empty

Why is my code able to save data to the database using Ajax, but all rows are empty? Here is My Form: <form name="frm" id="frm" action=""> <div class="form-group"> <label for="namaproduk">Product Name</label> <input t ...

Tips for dynamically changing the body class based on the page in a remix

I am trying to set parameters for the body class in root.jsx, which will change based on the page being viewed. I want to assign different values to the class in each route - for example, in _index it should be "company homepage", and in the restaurants ro ...

Utilize the jQuery autocomplete UI Widget to trigger a select event on a dynamically generated row in a table

Currently, I have successfully implemented a jQuery autocomplete feature on the text input of a table data element called txtRow1. The data for this autocomplete is fetched remotely from a MySQL database and returned in JSON format as 'value' for ...

Having trouble transferring data between Vue.JS components

Wondering how to pass data from the parent component (Home route) to the child component (playlist route) using props? Encountering a "TypeError: Cannot read property 'length' of undefined" error in the child component? These two components are c ...

Tips for showcasing the latest Google Map InfoWindows above previous ones

I have a dynamic Google Map with InfoWindows being added dynamically, but I am facing an issue where overlapping InfoWindows do not always display the most recent one on top of older ones. Is there a way to ensure that the latest InfoWindow always shows u ...

Iterating through the nested JSON causes an error when trying to set properties of undefined

My dataset is structured as a nested JSON, with the main object named bwaResult. Within this object, there are three primary groups: actBwa, fcBwa, and planBwa. Each of these groups contains yearly data and results that include years. I am trying to organi ...

Creating an alert pop-up that displays text based on the prompt input type: A step-by-step guide

I'm a new to Javascript and I'm trying out some basic scripts. My objective is to display a prompt message (1.) asking for a name, then show an alert (2.) based on the input from the prompt. If the input is a valid name (a string), then the alert ...

What steps should I follow to integrate testing into a project built using vue cli that has already been established?

Following the steps outlined in this guide, when I execute vue init webpack my-project, I am presented with a questionnaire that inquires about including linting and testing. If I choose to include them, the project is configured with testing capabilities. ...

Slider displays images generated by PHP in a horizontal motion

Currently, I am in the process of creating a custom horizontal slider for my client's personalized gallery. The gallery comprises elements displayed as a no-wrap, multi-window-width block, designed to change its margin-left when the slider arrows are ...

JavaScript function that adjusts the top position when toggling

When the user clicks on a div, it expands or closes. I also want to adjust the top position of another fixed div based on the state of the original div. For instance: If the original div is expanded, I want the second div to have top:10px If the original ...

The onreadystatechange function does not get triggered in Firefox

Below are the codes I have written: Function for sending an AJAX request and getting a value in return: function myAjaxCall(){ var myValue=0; var async = false; //I need to make a synchronized request, otherwise the return value is 0 xmlhttp.ope ...

Tips for implementing a regular expression in JavaScript to parse tags from a Docker image?

I recently came across this regex for parsing docker image tag in Python. ^(?P<repository>[\w.\-_]+((?::\d+|)(?=/[a-z0-9._-]+/[a-z0-9._-]+))|)(?:/|)(?P<image>[a-z0-9.\-_]+(?:/[a-z0-9.\-_]+|))(:(?P<tag>[\w.&bs ...

What is the best way to trigger the ajax request with the same post parameter upon pressing the browser's back button?

Is there a way to remember the post parameters and resend an AJAX request when the browser back button is pressed? I have searched online and found a couple of methods: Using localsotrage or document.location.hash when the page unloads. Using cookie ...

Guide on passing a JSON body as a string in a PUT API request using Fetch in a React.js application

How can I pass a JSON body as a string in a FETCH PUT API in React JS? I am attempting to add 20 to the Balance like this: Balance: details[0].Balance.toString() + 20, but it is not working as expected. I want the entire result to be a string. Any assista ...

Tips for utilizing $http and $location in custom directives

I'm completely new to working with Angular, and I have a simple question about using $http and $location in directives. I'm trying to create a task list and would like to be able to delete an entry when clicking on a link. Right now, I've a ...

How can I resolve the Vue warning about an unknown custom element <password-input>?

I've been working on resolving an error within a component, but unfortunately, I'm still encountering issues. The error message is as follows: [Vue warn]: Unknown custom element: - have you registered the component correctly? For recursive co ...

moving all duplicate elements in an array into a separate array

I am struggling to achieve the result [1,1,1,1,2,2,20,20] from the given array. My goal is to extract all duplicate values into a new array, but I just can't seem to get it right. Can you please assist me? const array = [1, 2, 4, 591, 392, 391, 2, ...

Creating a grid layout with Handlebars

I am looking to create a grid with 10 rows and 10 columns using Handlebars. I have already set up the following template: <script id="battlefield-tmpl" type="x-handlebars-template"> {{#each rows}} <div class="battlefield__row"> ...

Is it possible to utilize Vue's v-for function without the need for ul or ol elements?

Hey there, I'm just starting out with Vue and I'm looking to display some data in rows without using numbers or bullet points. Is there a different way to achieve this without the current approach I have below? <li v-for="product in contract. ...