为了账号安全,请及时绑定邮箱和手机立即绑定

定义常量报错'types' can only be used in a .ts file.

https://img1.sycdn.imooc.com//5c21a4ce0001bc8f04590481.jpg

在vscode中报错 'types' can only be used in a .ts file.

这是什么原因  我安装了es6插件  是语法的错误吗

正在回答

3 回答


【蜘蛛侠TG@abin789】-7400
【蜘蛛侠TG@abin789】-7401
【蜘蛛侠TG@abin789】-7402
【蜘蛛侠TG@abin789】-7403
【蜘蛛侠TG@abin789】-7404
【蜘蛛侠TG@abin789】-7405
【蜘蛛侠TG@abin789】-7406
【蜘蛛侠TG@abin789】-7407
【蜘蛛侠TG@abin789】-7408
【蜘蛛侠TG@abin789】-7409
【蜘蛛侠TG@abin789】-7410
【蜘蛛侠TG@abin789】-7411
【蜘蛛侠TG@abin789】-7412
【蜘蛛侠TG@abin789】-7413
【蜘蛛侠TG@abin789】-7414
【蜘蛛侠TG@abin789】-7415
【蜘蛛侠TG@abin789】-7416
【蜘蛛侠TG@abin789】-7417
【蜘蛛侠TG@abin789】-7418
【蜘蛛侠TG@abin789】-7419
【蜘蛛侠TG@abin789】-7420
【蜘蛛侠TG@abin789】-7421
【蜘蛛侠TG@abin789】-7422
【蜘蛛侠TG@abin789】-7423
【蜘蛛侠TG@abin789】-7424
【蜘蛛侠TG@abin789】-7425
【蜘蛛侠TG@abin789】-7426
【蜘蛛侠TG@abin789】-7427
【蜘蛛侠TG@abin789】-7428
【蜘蛛侠TG@abin789】-7429
【蜘蛛侠TG@abin789】-7430
【蜘蛛侠TG@abin789】-7431
【蜘蛛侠TG@abin789】-7432
【蜘蛛侠TG@abin789】-7433
【蜘蛛侠TG@abin789】-7434
【蜘蛛侠TG@abin789】-7435
【蜘蛛侠TG@abin789】-7436
【蜘蛛侠TG@abin789】-7437
【蜘蛛侠TG@abin789】-7438
【蜘蛛侠TG@abin789】-7439
【蜘蛛侠TG@abin789】-7440
【蜘蛛侠TG@abin789】-7441
【蜘蛛侠TG@abin789】-7442
【蜘蛛侠TG@abin789】-7443
【蜘蛛侠TG@abin789】-7444
【蜘蛛侠TG@abin789】-7445
【蜘蛛侠TG@abin789】-7446
【蜘蛛侠TG@abin789】-7447
【蜘蛛侠TG@abin789】-7448
【蜘蛛侠TG@abin789】-7449
【蜘蛛侠TG@abin789】-7450
【蜘蛛侠TG@abin789】-7451
【蜘蛛侠TG@abin789】-7452
【蜘蛛侠TG@abin789】-7453
【蜘蛛侠TG@abin789】-7454
【蜘蛛侠TG@abin789】-7455
【蜘蛛侠TG@abin789】-7456
【蜘蛛侠TG@abin789】-7457
【蜘蛛侠TG@abin789】-7458
【蜘蛛侠TG@abin789】-7459
【蜘蛛侠TG@abin789】-7460
【蜘蛛侠TG@abin789】-7461
【蜘蛛侠TG@abin789】-7462
【蜘蛛侠TG@abin789】-7463
【蜘蛛侠TG@abin789】-7464
【蜘蛛侠TG@abin789】-7465
【蜘蛛侠TG@abin789】-7466
【蜘蛛侠TG@abin789】-7467
【蜘蛛侠TG@abin789】-7468
【蜘蛛侠TG@abin789】-7469
【蜘蛛侠TG@abin789】-7470
【蜘蛛侠TG@abin789】-7471
【蜘蛛侠TG@abin789】-7472
【蜘蛛侠TG@abin789】-7473
【蜘蛛侠TG@abin789】-7474
【蜘蛛侠TG@abin789】-7475
【蜘蛛侠TG@abin789】-7476
【蜘蛛侠TG@abin789】-7477
【蜘蛛侠TG@abin789】-7478
【蜘蛛侠TG@abin789】-7479
【蜘蛛侠TG@abin789】-7480
【蜘蛛侠TG@abin789】-7481
【蜘蛛侠TG@abin789】-7482
【蜘蛛侠TG@abin789】-7483
【蜘蛛侠TG@abin789】-7484
【蜘蛛侠TG@abin789】-7485
【蜘蛛侠TG@abin789】-7486
【蜘蛛侠TG@abin789】-7487
【蜘蛛侠TG@abin789】-7488
【蜘蛛侠TG@abin789】-7489
【蜘蛛侠TG@abin789】-7490
【蜘蛛侠TG@abin789】-7491
【蜘蛛侠TG@abin789】-7492
【蜘蛛侠TG@abin789】-7493
【蜘蛛侠TG@abin789】-7494
【蜘蛛侠TG@abin789】-7495
【蜘蛛侠TG@abin789】-7496
【蜘蛛侠TG@abin789】-7497
【蜘蛛侠TG@abin789】-7498
【蜘蛛侠TG@abin789】-7499
【蜘蛛侠TG@abin789】-7500
【蜘蛛侠TG@abin789】-7501
【蜘蛛侠TG@abin789】-7502
【蜘蛛侠TG@abin789】-7503
【蜘蛛侠TG@abin789】-7504
【蜘蛛侠TG@abin789】-7505
【蜘蛛侠TG@abin789】-7506
【蜘蛛侠TG@abin789】-7507
【蜘蛛侠TG@abin789】-7508
【蜘蛛侠TG@abin789】-7509
【蜘蛛侠TG@abin789】-7510
【蜘蛛侠TG@abin789】-7511
【蜘蛛侠TG@abin789】-7512
【蜘蛛侠TG@abin789】-7513
【蜘蛛侠TG@abin789】-7514
【蜘蛛侠TG@abin789】-7515
【蜘蛛侠TG@abin789】-7516
【蜘蛛侠TG@abin789】-7517
【蜘蛛侠TG@abin789】-7518
【蜘蛛侠TG@abin789】-7519
【蜘蛛侠TG@abin789】-7520
【蜘蛛侠TG@abin789】-7521
【蜘蛛侠TG@abin789】-7522
【蜘蛛侠TG@abin789】-7523
【蜘蛛侠TG@abin789】-7524
【蜘蛛侠TG@abin789】-7525
【蜘蛛侠TG@abin789】-7526
【蜘蛛侠TG@abin789】-7527
【蜘蛛侠TG@abin789】-7528
【蜘蛛侠TG@abin789】-7529
【蜘蛛侠TG@abin789】-7530
【蜘蛛侠TG@abin789】-7531
【蜘蛛侠TG@abin789】-7532
【蜘蛛侠TG@abin789】-7533
【蜘蛛侠TG@abin789】-7534
【蜘蛛侠TG@abin789】-7535
【蜘蛛侠TG@abin789】-7536
【蜘蛛侠TG@abin789】-7537
【蜘蛛侠TG@abin789】-7538
【蜘蛛侠TG@abin789】-7539
【蜘蛛侠TG@abin789】-7540
【蜘蛛侠TG@abin789】-7541
【蜘蛛侠TG@abin789】-7542
【蜘蛛侠TG@abin789】-7543
【蜘蛛侠TG@abin789】-7544
【蜘蛛侠TG@abin789】-7545
【蜘蛛侠TG@abin789】-7546
【蜘蛛侠TG@abin789】-7547
【蜘蛛侠TG@abin789】-7548
【蜘蛛侠TG@abin789】-7549
【蜘蛛侠TG@abin789】-7550
【蜘蛛侠TG@abin789】-7551
【蜘蛛侠TG@abin789】-7552
【蜘蛛侠TG@abin789】-7553
【蜘蛛侠TG@abin789】-7554
【蜘蛛侠TG@abin789】-7555
【蜘蛛侠TG@abin789】-7556
【蜘蛛侠TG@abin789】-7557
【蜘蛛侠TG@abin789】-7558
【蜘蛛侠TG@abin789】-7559
【蜘蛛侠TG@abin789】-7560
【蜘蛛侠TG@abin789】-7561
【蜘蛛侠TG@abin789】-7562
【蜘蛛侠TG@abin789】-7563
【蜘蛛侠TG@abin789】-7564
【蜘蛛侠TG@abin789】-7565
【蜘蛛侠TG@abin789】-7566
【蜘蛛侠TG@abin789】-7567
【蜘蛛侠TG@abin789】-7568
【蜘蛛侠TG@abin789】-7569
【蜘蛛侠TG@abin789】-7570
【蜘蛛侠TG@abin789】-7571
【蜘蛛侠TG@abin789】-7572
【蜘蛛侠TG@abin789】-7573
【蜘蛛侠TG@abin789】-7574
【蜘蛛侠TG@abin789】-7575
【蜘蛛侠TG@abin789】-7576
【蜘蛛侠TG@abin789】-7577
【蜘蛛侠TG@abin789】-7578
【蜘蛛侠TG@abin789】-7579
【蜘蛛侠TG@abin789】-7580
【蜘蛛侠TG@abin789】-7581
【蜘蛛侠TG@abin789】-7582
【蜘蛛侠TG@abin789】-7583
【蜘蛛侠TG@abin789】-7584
【蜘蛛侠TG@abin789】-7585
【蜘蛛侠TG@abin789】-7586
【蜘蛛侠TG@abin789】-7587
【蜘蛛侠TG@abin789】-7588
【蜘蛛侠TG@abin789】-7589
【蜘蛛侠TG@abin789】-7590
【蜘蛛侠TG@abin789】-7591
【蜘蛛侠TG@abin789】-7592
【蜘蛛侠TG@abin789】-7593
【蜘蛛侠TG@abin789】-7594
【蜘蛛侠TG@abin789】-7595
【蜘蛛侠TG@abin789】-7596
【蜘蛛侠TG@abin789】-7597
【蜘蛛侠TG@abin789】-7598
【蜘蛛侠TG@abin789】-7599

0 回复 有任何疑惑可以回复我~

请问应该怎么改呢?


0 回复 有任何疑惑可以回复我~

我知道了 老师这个是es5的写法 而我用create-react-app构建的写法是es6的写法

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
React实战--打造画廊应用(上)
  • 参与学习       57309    人
  • 解答问题       273    个

颠覆式前端UI开发框架 React,打造图片画廊实践案讲解

进入课程

定义常量报错'types' can only be used in a .ts file.

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信