Giter VIP home page Giter VIP logo

open-component-vscode-vue3-vite's Introduction

openComponent-vscode-vue3-vite

介绍

vue3项目通过vscode打开对应的组件文件,快速定位组件文件

安装教程

npm install -D open-component-vscode-vue3-vite

使用说明

  1. 在vite.config.js中配置open-component-vscode-vue3-vite的plugin
// vite.config.js
import openVscode from 'open-component-vscode-vue3-vite';


export default defineApplicationConfig({
  overrides: {
    plugins: [
      process.env.NODE_ENV === 'development' && openVscode()
    ],
  },
});
  1. 在main.js中注册对应的全局方法
import { createApp } from 'vue';

import App from './App.vue';

async function bootstrap() {
  const app = createApp(App);

  app.mount('#app');

  // 注册全局方法
  app.config.globalProperties.$openVscode = function (path) {
    // 在这里编写你的全局方法的逻辑
    window.open(path, '_self');
  };
}

bootstrap();
  1. 在运行时环境通过shift + alt + 鼠标左键点击,打开对应的组件文件(后续会迭代为可配置按键)

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request

open-component-vscode-vue3-vite's People

Contributors

zjc2233 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.