根據老師的代碼,報錯
ERROR in ./src/store.js Module not found: Error: Cannot resolve module 'babel-runtime/core-js/json/stringify' in D:\git\vue-test\src resolve module babel-runtime/core-js/json/stringify in D:\git\vue-test\src ?looking for modules in D:\git\vue-test\node_modules ? ?D:\git\vue-test\node_modules\babel-runtime doesn't exist (module as directory) ?looking for modules in D:\git\vue-test\node_modules ? ?D:\git\vue-test\node_modules\babel-runtime doesn't exist (module as directory) [D:\git\vue-test\node_modules\babel-runtime] [D:\git\vue-test\node_modules\babel-runtime] @ ./src/store.js 7:17-64
2016-11-02
代碼更新使用localstorage 插件,參考
https://github.com/fishenal/Todos_Vuejs
2016-11-10
const STORAGE_KEY='todos-vuejs'
export default{
fetch:function (){
return window.JSON.parse(window.localStorage.getItem(STORAGE_KEY)||'[]')
},
save:function (items){
window.localStorage.setItem(STORAGE_KEY,window.JSON.stringify(items))
}
}
把store.js文件改成這樣就成功了
2016-10-15
這個把這個模塊安裝上就好了,現在都是vue2.0了,老師講課的時候還是1.0
npm install bable-runtime -save