so11y / unplugin-vue-component-ref

用于获取setup组件ref全部导出
MIT License
12 stars 1 forks source link

unplugin-vue-component-ref

用于获取setup组件ref全部导出


使用方式

//client

import {createApp} from "vue"
import App from "./app"
import unpluginVueRef from "unplugin-vue-component-ref/client"

createApp(App).use(unpluginVueRef)

vite

import { vitePlugin } from "unplugin-vue-component-ref/node";

interface Options {
    include?: FilterPattern;
    exclude?: FilterPattern;
}

export default defineConfig({
  plugins: [
    vitePlugin({ /* options */ }) //
  ],
});

vue.config.js

const { webpackPlugin } = require("unplugin-vue-component-ref/node") ;

interface Options {
    include?: FilterPattern;
    exclude?: FilterPattern;
}

module.exports = {
  configureWebpack: {
    plugins: [
      webpackPlugin({ /* options */ }),
    ],
  },
};