V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
ghostgril
V2EX  ›  问与答

前端项目 import '@/components/home.vue'里的 @是什么意思呢

  •  
  •   ghostgril · Apr 15, 2018 · 6998 views
    This topic created in 2936 days ago, the information mentioned may be changed or developed.

    我在做一个 vue 项目的时候,直接使用'/components/home.vue'获取不到模块,最前面加 /应该是根路径去找了吧为何要加上这个 @

    5 replies    2018-04-16 15:01:49 +08:00
    SergeGao
        1
    SergeGao  
       Apr 15, 2018 via Android   ❤️ 1
    是自行配置的一个 alias
    83f420984
        2
    83f420984  
       Apr 15, 2018 via iPhone
    @默认是从 src 目录开始查找,也可以自己配置一些其它路径或者符号
    LeungJZ
        3
    LeungJZ  
       Apr 15, 2018
    根目录的别名,可以自行在 webpack.config.js 里面的 alias 去设置。
    VDimos
        4
    VDimos  
       Apr 15, 2018 via Android
    这个是 webpack 的别名,自己设置的
    retroxs
        5
    retroxs  
       Apr 16, 2018
    webpack 的 alias
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   972 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 19:50 · PVG 03:50 · LAX 12:50 · JFK 15:50
    ♥ Do have faith in what you're doing.