ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

求助贴

2022-03-01 03:00:07  阅读:119  来源: 互联网

标签:Vue console log res 求助 import id


 

 

vue.esm.js?efeb:628 [Vue warn]: Unknown custom element: <dv> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

found in

---> <Home> at src/components/home.vue
<App> at src/App.vue
<Root>

 

报该错误请大佬们解答,

路由如下

import Vue from 'vue'
import Router from 'vue-router'
import home from "../components/home";
import login from "../components/login";
import more from "../components/more";
import 'element-ui/lib/theme-chalk/index.css';
import ElementUI from 'element-ui';

// import {
// Button,Icon,Link,Radio,Row,Col,Container,Header,Main,Footer,Aside,
// Carousel,CarouselItem,
// } from 'element-ui';
Vue.use(ElementUI)
Vue.use(Router)

export default new Router({
routes: [
{
path:'/',
redirect:"/home"
},
{
path: '/home',
component:home
},
{
path: '/login',
component:login
},
{
path: '/more',
component:more
},
]
})

main 如下
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import vuex from 'vuex'
Vue.use(vuex)
Vue.config.productionTip = false
new Vue({
el: '#app',
router,
store,
components: { App },
template: '<App/>'
})

 

其中一个views视图的vue如下

<script>

import {searchMusic,musicPlay,hotMusic,hotComment} from "../Api/api.js";
export default {
name: "home",
created() {
hotMusic().then((res)=>{
console.log(res);
this.musicList=res.data.data.dailySongs;
console.log(this.musicList)
})
},
data() {
return {
//用户输入
user_input:'',
//歌曲列表
musicList: [],
//歌曲地址
musicSrc:'',
//歌曲列表显示或隐藏
active:true,
//歌曲列表标题切换
titleActive:false,
//歌曲头像
mAvatar:'',
//头像显示指针
isAvatar:false,
//评论列表
commentList:[],
//歌曲评论指针
com_body:false,
}
},
methods:{
//歌曲搜索
searchMusic(){
var that = this;
searchMusic({keywords:this.user_input}).then((res)=>{
console.log(res)
that.musicList =res.data.result.songs;
console.log(that.musicList)
that.active = true;
this.titleActive=true;
})
},
//关闭搜索列表
cls(){
this.active = false;
},
//打开搜索列表
opn(){
this.active = !this.active;
},
// 歌曲播放
playMusic(id,index){
var that= this;
//调出歌曲头像和评论
this.com_body=true;
this.isAvatar= true;
musicPlay({id:id}).then((res)=>{
// console.log(res)
// console.log(id)
that.musicSrc = res.data.data[0].url;
// console.log(that.musicSrc)
that.mAvatar = that.musicList[index].al.picUrl
hotComment({id:id}).then((res)=>{
console.log(res)
})
hotComment({id:id,limit:50}).then((res)=>{
console.log("--------")
console.log(res)
that.commentList = res.data.comments;
})
})

}
}
}
</script>

 

标签:Vue,console,log,res,求助,import,id
来源: https://www.cnblogs.com/zhengzhijian/p/15948403.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有