@fox2/vfox-resolver
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

@fox2/vfox-resolver

unplugin-vue-components Resolver for Vfox

使用方式

  1. 先安装插件:
npm i unplugin-vue-components -D
  1. 安装组件 Resolver:
npm i @fox2/vfox-resolver -D
  1. 配置 config

vite.config.js:

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite'
import { VfoxResolver } from '@fox2/vfox-resolver'

export default defineConfig({
  plugins: [
    vue(),
    Components({
      resolvers: [VfoxResolver()]
    })
  ]
})

Or vue.config.js

const Components = require('unplugin-vue-components/webpack')
const { VfoxResolver } = require('@fox2/vfox-resolver')

module.exports = {
  configureWebpack: {
    plugins: [
      Components({
        resolvers: [VfoxResolver()]
      })
    ]
  }
}
  1. 现在就可以在模版中引入组件
<template>
  <fx-button>提交</fx-button>
</template>

参数

importStyle

type ImportStyle = boolean | 'css' | 'sass'

假设我们按需引入了 Button 组件:

// set true or 'css' or no set
import 'vfox/es/Button/style/index'

// set 'sass'
import 'vfox/es/Button/style/sass'

// set false

format

type Format = 'esm' | 'cjs'

假设我们按需引入了 Button 组件:

// set 'esm' or no set
import 'vfox/es/Button'

// set 'cjs'
import 'vfox/lib/Button'

Package Sidebar

Install

npm i @fox2/vfox-resolver

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

8.6 kB

Total Files

6

Last publish

Collaborators

  • godxiaoji