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

最近在学 vue,所以用 vs code 的话都是手写 import?

  •  
  •   EeffDev · Jul 6, 2023 · 615 views
    This topic created in 1027 days ago, the information mentioned may be changed or developed.

    还是我没有找到魔法? 我发现使用 vue 本身的一些方法的时候,是可以自动 import 的

    但是当对于我自己写的 vue 文件时,无法像 idea 一样,直接输入方法名,然后 cmd+回车自动 import ,需要手动去写,虽然有什么 @可以帮忙提示,但是感觉恶心干呕。

    没有好办法吗?

    image.png

    wdssmq
        1
    wdssmq  
       Jul 6, 2023
    有一些 Vite 插件可以用,

    import Components from 'unplugin-vue-components/vite'
    import AutoImport from 'unplugin-auto-import/vite'

    antfu/vitesse-lite: ⛺️ Lightweight version of Vitesse
    https://github.com/antfu/vitesse-lite
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5988 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 02:16 · PVG 10:16 · LAX 19:16 · JFK 22:16
    ♥ Do have faith in what you're doing.