V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
xpyusrs
V2EX  ›  Vue.js

vue3 设置 @路径别名后, 编辑器没有提示

  •  
  •   xpyusrs · 2022-06-07 22:45:58 +08:00 · 1501 次点击
    这是一个创建于 660 天前的主题,其中的信息可能已经有所发展或是发生改变。
     resolve: {
        alias: {
          '@': resolve(__dirname, 'src')
        }
      },
    

    这样设置后编辑器导入的时候 @ 没有提示, 但是能正确导入 https://github.com/pylist/vue3-template 大佬们能帮我看看什么问题吗?

    2 条回复    2022-06-07 23:48:36 +08:00
    ddiu8081
        1
    ddiu8081  
       2022-06-07 23:02:46 +08:00
    需要根目录配置 tsconfig.json 或 jsconfig.json

    https://gist.github.com/ddiu8081/e6bfffdcea98d37e183109c98996595c
    xpyusrs
        2
    xpyusrs  
    OP
       2022-06-07 23:48:36 +08:00
    @ddiu8081 感谢, 原来这个原因
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1021 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 19:57 · PVG 03:57 · LAX 12:57 · JFK 15:57
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.