jkchao / blog-admin

blog-admin @react、@typescript、@apollographql
https://admin.jkchao.cn
233 stars 52 forks source link

麻烦问下这个报错啥意思啊?谢谢 #6

Closed chenxuan0000 closed 6 years ago

chenxuan0000 commented 6 years ago

ERROR Failed to compile with 18 errors 21:16:50 error in G:\github\vue-admin\src\components\card.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\components\card.vue.tsx(32,3) TS2564: Property 'carLoading' has no initializer and is not definitely assigned in the constructor.

error in G:\github\vue-admin\src\components\card.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\components\card.vue.tsx(35,3) TS2564: Property 'width' has no initializer and is not definitely assigned in the constructor.

error in G:\github\vue-admin\src\components\card.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\components\card.vue.tsx(38,3) TS2564: Property 'type' has no initializer and is not definitely assigned in the constructor.

error in G:\github\vue-admin\src\pages\book\index.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\pages\book\index.vue.tsx(224,11) TS2564: Property 'state' has no initializer and is not definitely assigned in the constructor.

error in G:\github\vue-admin\src\pages\book\index.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\pages\book\index.vue.tsx(291,24) TS2339: Property 'assign' does not exist on type 'typeof Object'.

error in G:\github\vue-admin\src\pages\book\index.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\pages\book\index.vue.tsx(326,27) TS2339: Property 'assign' does not exist on type 'typeof Object'.

error in G:\github\vue-admin\src\pages\heros\index.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\pages\heros\index.vue.tsx(164,11) TS2564: Property 'state' has no initializer and is not definitely assigned in the constructor.

error in G:\github\vue-admin\src\pages\tags\index.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\pages\tags\index.vue.tsx(144,24) TS2339: Property 'assign' does not exist on type 'typeof Object'.

error in G:\github\vue-admin\src\pages\tags\index.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\pages\tags\index.vue.tsx(178,27) TS2339: Property 'assign' does not exist on type 'typeof Object'.

error in G:\github\vue-admin\src\pages\set\index.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\pages\set\index.vue.tsx(179,3) TS2564: Property '$refs' has no initializer and is not definitely assigned in the constructor.

error in G:\github\vue-admin\src\pages\article\release.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\pages\article\release.vue.tsx(185,24) TS2339: Property 'assign' does not exist on type 'typeof Object'.

error in G:\github\vue-admin\src\pages\comments\index.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\pages\comments\index.vue.tsx(187,11) TS2564: Property 'state' has no initializer and is not definitely assigned in the constructor.

error in G:\github\vue-admin\src\pages\login.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\pages\login.vue.tsx(46,3) TS2564: Property '$refs' has no initializer and is not definitely assigned in the constructor.

error in ./src/utils/loginIn.ts

[tsl] ERROR in G:\github\vue-admin\src\utils\loginIn.ts(8,15) TS2339: Property 'localStorage' does not exist on type 'typeof window'.

error in ./src/utils/loginIn.ts

[tsl] ERROR in G:\github\vue-admin\src\utils\loginIn.ts(9,38) TS2339: Property 'localStorage' does not exist on type 'typeof window'.

error in ./src/store/index.ts

[tsl] ERROR in G:\github\vue-admin\src\store\index.ts(60,14) TS2339: Property 'localStorage' does not exist on type 'typeof window'.

error in ./src/api/axios.ts

[tsl] ERROR in G:\github\vue-admin\src\api\axios.ts(21,14) TS2339: Property 'localStorage' does not exist on type 'typeof window'.

error in ./src/api/axios.ts

[tsl] ERROR in G:\github\vue-admin\src\api\axios.ts(22,64) TS2339: Property 'localStorage' does not exist on type 'typeof window'. 终止批处理操作吗(Y/N)? ^Cy PS G:\github\vue-admin> npm start

admin@1.0.0 start G:\github\vue-admin npm run dev

admin@1.0.0 dev G:\github\vue-admin webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

94% asset optimization

ERROR Failed to compile with 18 errors 21:20:41 error in G:\github\vue-admin\src\components\card.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\components\card.vue.tsx(32,3) TS2564: Property 'carLoading' has no initializer and is not definitely assigned in the constructor.

error in G:\github\vue-admin\src\components\card.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\components\card.vue.tsx(35,3) TS2564: Property 'width' has no initializer and is not definitely assigned in the constructor.

error in G:\github\vue-admin\src\components\card.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\components\card.vue.tsx(38,3) TS2564: Property 'type' has no initializer and is not definitely assigned in the constructor.

error in G:\github\vue-admin\src\pages\book\index.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\pages\book\index.vue.tsx(224,11) TS2564: Property 'state' has no initializer and is not definitely assigned in the constructor.

error in G:\github\vue-admin\src\pages\book\index.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\pages\book\index.vue.tsx(291,24) TS2339: Property 'assign' does not exist on type 'typeof Object'.

error in G:\github\vue-admin\src\pages\book\index.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\pages\book\index.vue.tsx(326,27) TS2339: Property 'assign' does not exist on type 'typeof Object'.

error in G:\github\vue-admin\src\pages\set\index.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\pages\set\index.vue.tsx(179,3) TS2564: Property '$refs' has no initializer and is not definitely assigned in the constructor.

error in G:\github\vue-admin\src\pages\comments\index.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\pages\comments\index.vue.tsx(187,11) TS2564: Property 'state' has no initializer and is not definitely assigned in the constructor.

error in G:\github\vue-admin\src\pages\heros\index.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\pages\heros\index.vue.tsx(164,11) TS2564: Property 'state' has no initializer and is not definitely assigned in the constructor.

error in G:\github\vue-admin\src\pages\article\release.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\pages\article\release.vue.tsx(185,24) TS2339: Property 'assign' does not exist on type 'typeof Object'.

error in G:\github\vue-admin\src\pages\tags\index.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\pages\tags\index.vue.tsx(144,24) TS2339: Property 'assign' does not exist on type 'typeof Object'.

error in G:\github\vue-admin\src\pages\tags\index.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\pages\tags\index.vue.tsx(178,27) TS2339: Property 'assign' does not exist on type 'typeof Object'.

error in G:\github\vue-admin\src\pages\login.vue.tsx

[tsl] ERROR in G:\github\vue-admin\src\pages\login.vue.tsx(46,3) TS2564: Property '$refs' has no initializer and is not definitely assigned in the constructor.

error in ./src/utils/loginIn.ts

[tsl] ERROR in G:\github\vue-admin\src\utils\loginIn.ts(8,15) TS2339: Property 'localStorage' does not exist on type 'typeof window'.

error in ./src/utils/loginIn.ts

[tsl] ERROR in G:\github\vue-admin\src\utils\loginIn.ts(9,38) TS2339: Property 'localStorage' does not exist on type 'typeof window'.

error in ./src/store/index.ts

[tsl] ERROR in G:\github\vue-admin\src\store\index.ts(60,14) TS2339: Property 'localStorage' does not exist on type 'typeof window'.

error in ./src/api/axios.ts

[tsl] ERROR in G:\github\vue-admin\src\api\axios.ts(21,14) TS2339: Property 'localStorage' does not exist on type 'typeof window'.

error in ./src/api/axios.ts

[tsl] ERROR in G:\github\vue-admin\src\api\axios.ts(22,64) TS2339: Property 'localStorage' does not exist on type 'typeof window'.

jkchao commented 6 years ago

@chenxuan0000 tsconfig.json 里加 "strictPropertyInitialization": false 试试。

chenxuan0000 commented 6 years ago

image 少了 几个问题了, 不过还有报错 没用过ts不太清楚 叨扰了,自己查了下没啥用,我是window系统难道和系统还有关系。 对了 image node-koa起起来了

jkchao commented 6 years ago

TypeScript 是哪个版本了?

chenxuan0000 commented 6 years ago

2.7.2了 大佬可否留个qq什么方便问几个问题

jkchao commented 6 years ago

加我微信把,qq_419027396

ghost commented 6 years ago

对于assign这个问题可以用 deep-assign 这个库代替Object.assign @chenxuan0000