track.jsclass Track { constructor(title, artist, album, albumArt, audio) { this.title = title; this.artist = artist; this.album = album; this.albumArt = albumArt; this.audio = audio; }; returnValue(){ return( { title: this.title, artist: this.artist, album: this.album, audio: this.audio, albumArt: this.albumArt, } ) }}search.jsimport Track from '../models/track';let a = new Track(1,2,3,4,5);報錯誰給看看, 不知道什么原因。。。已經(jīng)找到原因了, 忘記導出,在track.js最后加一行export default Track;
ES6 實例化失敗,不知道問題出在哪里?
桃花長相依
2018-12-12 18:19:54