@arksjs/ui-resolver
v0.0.1
Published
unplugin-vue-components resolver for arkui-mobile-vue
Downloads
3
Readme
@arksjs/ui-resolver
unplugin-vue-components Resolver for ArkUI。
使用方式
- 先安装插件:
npm i unplugin-vue-components -D
- 安装组件 Resolver:
npm i @arksjs/ui-resolver -D
- 配置 config
vite.config.js
:
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite'
import { ArkUIResolver } from '@arksjs/ui-resolver'
export default defineConfig({
plugins: [
vue(),
Components({
resolvers: [ArkUIResolver()]
})
]
})
Or vue.config.js
const Components = require('unplugin-vue-components/webpack')
const { ArkUIResolver } = require('@arksjs/ui-resolver')
module.exports = {
configureWebpack: {
plugins: [
Components({
resolvers: [ArkUIResolver()]
})
]
}
}
- 现在就可以在模版中引入组件
<template>
<ak-button>提交</ak-button>
</template>
参数
importStyle
type ImportStyle = boolean | 'css' | 'sass'
假设我们按需引入了 Button
组件:
// set true or 'css' or no set
import 'arkui-mobile-vue/es/Button/style/index'
// set 'sass'
import 'arkui-mobile-vue/es/Button/style/sass'
// set false
format
type Format = 'esm' | 'cjs'
假设我们按需引入了 Button
组件:
// set 'esm' or no set
import 'arkui-mobile-vue/es/Button'
// set 'cjs'
import 'arkui-mobile-vue/lib/Button'