[英]CSS is not working with vue js on dynamic routing
我在 vue 中创建了路由
{
path: '/coursedetailed/:id',
component: MyCourseDetailed,
props: true
},
它可以工作,但是在我转到页面后,似乎 css 已被禁用。 如果填充了数据,所有请求都是完整的组件。 控制台出现一个错误。 其他页面运行良好
未捕获的 SyntaxError:意外的令牌 <
我的组件的 vue 脚本:
<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 () {
axios({
method: 'get',
url: this.$store.state.endpoints.baseUrl + '/api/courses/' + this.$route.params.id + '/',
withCredentials: true,
headers: {
Authorization: `JWT ${this.$store.state.jwt}`,
'Content-Type': 'application/json'
}
}).then((response) => {
this.course = response.data
})
},
isToken () {
if (this.$store.state.jwt) {
this.$router.push({ path: '/profile' })
} else {
this.$router.push({ path: '/' })
}
}
}
}
问题可能出在哪里?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.