为什么使用es6 export,import会报错?
todo.html
import Store from "./store" console.log(Store);
store.js
const STORAGE_KEY='todos-vuejs'
export default {
fetch: function () {
return JSON.parse(window.localStorage.getItem(STORAGE_KEY)||'[]')
},
save: function () {
window.localStorage.setItem(STORAGE_KEY,JSON.stringify(items))
}
}错误信息todo.html:19 Uncaught SyntaxError: Unexpected token import