一,场景: 字符串转对象: var str = "{'bankRate':5,'YINGUO':0}" 二,操作: JSON.parse(str)时候,报错 [Vue warn]: Error in render: "SyntaxError: Unexpected token ' in JSON at position 1" 三,原因: 使用parse这个方法,要求很严格,必须是json的k和value都用双引号包起来: ex:"{"bankRa…
> music@1.0.0 dev F:\music\music> node build/dev-server.js > Starting dev server...ERROR Failed to compile with 2 errors14:30:11 error in ./src/App.vue Syntax Error: Unexpected token { @ ./src/main.js 4:0-24@ multi ./build/dev-client ./src/main.j…
What you did I have installed Swiper as normal dependency in my Project and import it to my scripts file like this import Swiper from 'swiper'; If I try to bundle it to a production ready version with webpack i get this error Unexpected token: name (…