0.2.0 • Published 2 years ago

@chengdx/utils v0.2.0

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

Tools

  • defaultExportResolver Help to import default export from a module in
// in vite.config.ts
import AutoImportComponents from 'vite-vue-components/vite'
import { defaultExportResolver } from '@chengdx/utils'

export default defineConfig({
  plugins: [
    AutoImportComponents({
      dts: true,
      resolvers: [
        defaultExportResolver([
          { name: 'VChart', from: 'vue-echarts' },
        ]),
      ],
    }),
  ],
})

Then in the components.d.ts:

// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core'
export {}
declare module '@vue/runtime-core' {
  export interface GlobalComponents {
    VChart: typeof import('vue-echarts')['default']
  }
}

Now you can use VChart in your template without import it.

<template>
  <v-chart />
</template>

License

MIT License © 2022 Cheng-DX

0.2.0

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago