0.1.1 • Published 2 years ago

oemmodule v0.1.1

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

oemmodule

组件下载

npm i oemmodule

全局使用方法

在vue3项目中全局引用的方式

//main.ts or main.js
import { createApp } from 'vue';
import App from './App.vue';
import oemmodule from 'oemmodule';

const app = createApp(App);

app.use(oemmodule);
app.mount('#app');

如果使用ts+vite的方式,需要在env.d.ts中加入最后一句声明,否则ts会检测报错。

/// <reference types="vite/client" />
declare module '*.vue' {
  import type { DefineComponent } from 'vue'
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
  const component: DefineComponent<{}, {}, any>
  export default component
}

declare module 'oemmodule';