The Vue router-view is not showing certain views as expected

Apologies for the extensive text. All of my router-views are functioning properly, except for one specific view which appears blank. Despite meticulously reviewing the code multiple times, I cannot identify any errors or warnings in the console. The structure and format of the problematic view is identical to others, with the only difference being the template itself. Previously, this was working fine, but due to complications in my package.json and dependencies, I had to start a new project. If you prefer, here's a link to a sandbox: https://codesandbox.io/s/condescending-monad-5o8qw

    <template>
  <div class="review-movie-detail">
    <div class="movie-image">
    <img :src="(`https://image.tmdb.org/t/p/original/${movie.poster_path}`)" alt="Movie Poster" />
    </div>

    <table class="movie-rating-details">
    <tr> <h2>{{movie.original_title}}</h2> </tr>
    <p> </p>
    <tr>Gore rating: <span class="emojiRatings" >{{getGoreEmoji()}} </span></tr>
    <tr><input v-model = "goreRating" type="range" min="1" max="100" class="slider" id="myRange"></tr>

    <tr> <div class="star-rating"> <star-rating v-model="rating"> </star-rating></div></tr>
    <tr><b-button class="block-button">Submit review</b-button></tr>
    </table>
  </div>
</template>

<script>
import { ref, onBeforeMount } from 'vue';
import env from '@/env.js'
import { useRoute } from 'vue-router';
import StarRating from 'vue-star-rating'

    
    
    export default {
      components : {StarRating},
      setup () {
        const movie = ref({});
        const route = useRoute();
        onBeforeMount(() => {
          fetch(`https://api.themoviedb.org/3/movie/${route.params.id}?api_key=${env.apikey}`)
    
            .then(response => response.json())
            .then(data => {
              movie.value = data;
            });
        });
        return {
          movie
        }
      },
      data() {
         return {
           goreRating: '50',
           shockRating : '50',
           jumpRating: '50',
           plotRating: '50',
           supernaturalRating: '50',
           rating: '3.5'
          }
        
      },
      methods: {
    getGoreEmoji() {
    let emojiRating = ["🩸", "🩸🩸", "🩸🩸🩸", "🩸🩸🩸🩸", "🩸🩸🩸🩸🩸", "🩸🩸🩸🩸🩸🩸"]
    return emojiRating[(Math.floor(this.goreRating/20))]
},

}
}

Here is my router configuration:

import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/Home.vue'
import MovieDetail from '../views/MovieDetail.vue'
import ReviewMovie from '../views/ReviewMovie.vue'



const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/movie/:id',
    name: 'Movie Detail',
    component: MovieDetail
  },
  {
    path: '/movie/:id/review',
    name: 'Review Movie',
    component: ReviewMovie
  }
]


const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router

Lastly, my app.Vue to display the router view...

<template>
<div>
<header>
  <GoBack />

  <router-link to="/">
  <h1><span>Horror</span>Hub</h1> 
  </router-link>
</header>
<main>
  <router-view></router-view>
</main>
</div>
</template>
<script>
import GoBack from "@/./components/GoBack"
export default {
  components: {
    GoBack
  }
  
}
</script>

Could someone kindly assist me in identifying the underlying cause of this issue? Thank you.

Answer â„–1

If you are utilizing Vue 3, it is recommended to install vue-star-rating@next

npm install vue-star-rating@next
or
yarn add vue-star-rating@next

In your package.json file, make sure to include:

"vue-star-rating": "^2.1.0"

Also, adopt the new syntax for implementation:

<star-rating v-model:rating="rating"></star-rating>

You can find a demo of this in action on codesandbox:

https://codesandbox.io/s/little-sea-xccm4?file=/src/views/ReviewMovie.vue

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

Examined unexplored branch that is a component of the OR condition

I am looking to test an uncovered branch in my codebase. Here is the scenario: https://i.sstatic.net/ZBKgi.png The test involves: describe('addCourseContentCard()', () => { it('should add course content card', () => { ...

Strangely unusual issues with text input boxes

So I've set up two textareas with the intention of having whatever is typed in one appear simultaneously in the other. But despite my best efforts, it's not working as expected. Here's the code snippet: <script> function copyText () { ...

Mastering Light and Camera Selection in Three.js

Question, In the editor found at this link, you can click on a light or camera to select it. I am familiar with using raycaster.intersectObjects(objects) to select meshes, but how can I achieve the same result for lights and cameras which do not have mesh ...

Ionic - encountering crashes with ion-nav-view on emulator

I am encountering an issue with ion-nav-view. Whenever I try to use it, the emulator displays a black screen, but it works perfectly fine in ionic serve. I suspect it may be a syntax error causing this problem. Interestingly, when I create a blank projec ...

Extract all nested array object values in JavaScript without including a specific key value

I am looking for a way to remove a specific key value pair within a nested array object in JavaScript. The goal is to get all the objects in the array after the removal. Can someone help me with this? In the following object, I want to remove the mon key ...

Click the button to instantly scroll to a particular word with highlighting, and with another click, jump to the next occurrence

In order to achieve the objective, simply click on a button that will search for and scroll to a specific word while highlighting it. The same button can be clicked again to find the next occurrence, and so on. If you need an example of how this works, ch ...

What is the best way to manage horizontal scrolling using buttons?

I was hoping that when the button is clicked, the scroll would move in the direction of the click while holding down the button. Initially, it worked flawlessly, but suddenly it stopped functioning. export default function initCarousel() { const carous ...

Generate JSON using JavaScript and post it to a web server by utilizing Ajax and PHP

I have researched extensively on the topic but I am still unable to make it work. I am trying to create an array in javascript and then utilize ajax to send it to a php file in order to generate a json file on the web server. This is my first time working ...

Ensure AngularJS ng-show and ng-hide are more secure

When using AngularJS, my goal is to conceal an element so that only authenticated users can access it. Although the ng-hide directive works, there is a vulnerability where someone could modify the class assigned to the element (ng-hide) using Developer To ...

What are the distinctions between Electron's built-in module and the one obtained through npm? And what is the method for accessing the electron object from external modules?

Electron Documentation If you refer to the official Electron installation guide, it recommends installing Electron using the following command: npm install electron --save-dev Following these instructions, I proceeded with the installation. However, upo ...

Looking for a way to limit the number of characters allowed per line in a textarea using jQuery

I have the following HTML textarea: <textarea name="splitRepComments" cols="20" rows="3" ></textarea> I have implemented a maxlength restriction using jQuery with the following function: var max = 100; $('#splitRepComments').bind(" ...

JS | How can we make an element with style=visibility:hidden become visible?

HTML: <div id="msg-text"><p><b id="msg" name="msg" style="visibility:hidden; color:#3399ff;">This is a hidden message</b></p></div> JS: $('#url').on('change keyup paste', function() { $('# ...

AngularJS - automatically submitting the initial item

Is there a simple way to automatically select the first item in my ng-repeat when the list is loaded for the user? Currently, I am using ng-click, but I am unsure of how to automatically trigger a click on the first item. Here is my ng-repeat: <div n ...

Refresh the current page in Next.js when a tab is clicked

I am currently working on a Next.js page located at /product While on the /product page, I want to be able to refresh the same page when I click on the product link in the top banner (navbar) that takes me back to /product. Is there a way to achieve this ...

Using axios to make a request from a server to itself

I'm facing an issue where I am attempting to send a request from the server to the same server using axios as a PUT method. Here is an example of what I have tried: await axios({ url: `http://localhost:4000${url}`, method: requestType, ...

What is the best way to implement an ng-change function on multiple fields within the same page without causing a cyclic call loop?

In my page, I have three angular-moment-datepicker fields - a date picker field, a month picker field, and a year picker field respectively. Here is the code: <input class="form-control" placeholder="BY DAY" ng-model="date" moment-picker="gDate" start- ...

I currently have two responsive menus and I'm trying to figure out how to modify the javascript so that when one menu is opened, the other

I am facing an issue with my responsive menus on a webpage, similar to the example provided in the jsfiddle link below. Currently, when one menu is open and I click on another, both remain open. How can I modify the JavaScript code so that when one menu op ...

Switching between dynamic Angular template classes

Creating an Angular HTML template with reactive form: <div class= "one"> <button class = "verticalButtonClass" (click) = "onClick()"> Label4 </button> </div> <div class = "two"> </bu ...

Vue's intelligent element loading feature ensures that elements that are not displayed are delayed

My Vue gallery component includes a lightbox feature defined by the following code: <div id="lightbox" class="modal" v-if="photo !== null" v-show="showModal" @click.self="closeModal"> <div clas ...

What steps can I take to avoid res.send() from replacing the entire document?

When making an ajax call to insert users into the database, I want to handle the response in a specific way. If I use res.send() on the server side, it displays the response at the top left of a black document, which is not ideal. I attempted to use retu ...