Recently, I implemented a route in my Vue application with the following configuration:
{
path: '/coursedetailed/:id',
component: MyCourseDetailed,
props: true
},
Everything seemed to be working fine until I navigated to the page and noticed that the CSS was not being applied. All requests were successfully completed and the components were filled with data. However, upon inspecting the console, I found an error message:
Uncaught SyntaxError: Unexpected token <
In my Vue script for the component, I have included the necessary code to fetch data from an API endpoint:
<script>
import axios from 'axios'
import MenuWhite from '@/components/MenuWhite.vue'
export default {
name: 'coursedetailed',
props: ['id'],
components: {
MenuWhite
},
data: () => {
return {
course: [],
errors: []
}
},
created () {
this.getData()
},
methods: {
getData () {
// Code to make API request and update 'course' data
},
isToken () {
// Code to check user authentication status and redirect accordingly
}
}
}
Despite reviewing the code multiple times, I am unable to pinpoint the exact source of the issue. Any suggestions or insights would be greatly appreciated.