@yh-ui/nuxt
Nuxt module for YH-UI
14,115
7
| Install | |
|---|---|
npm install @yh-ui/nuxt |
|
| Latest Version: | 1.0.63 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | Jun 23, 2026 |
| Links: | GitHub · npm |
Maintainer: lanhailang
@yh-ui/nuxt
YH-UI 的 Nuxt 3/4 模块。它负责注册组件、自动导入 Hooks 和全局方法、注入发布后的 CSS,并处理 Nuxt SSR 下常见的样式、ID 和依赖转译问题。
Highlights
- 零手写导入:
YhButton、YhTable、YhAiChat等组件可以直接在页面和组件中使用。 - Composable 自动导入:
useNamespace、useZIndex、useLocale、useVirtualScroll、useAiChat、useSKU等自动可用。 - 全局方法自动导入:
YhMessage、YhNotification、YhMessageBox、YhLoading、useAddressParser等常用能力直接调用。 - SSR 友好:运行时插件隔离请求状态,依赖自动 transpile,样式通过发布 CSS 入口注入。
- 可配置前缀:默认使用
Yh前缀,也可以通过prefix调整组件注册名。 - 支持 Nuxt
^3.11.0和^4.0.0-rc.1。
Install
pnpm add @yh-ui/nuxt
Setup
export default defineNuxtConfig({
modules: ['@yh-ui/nuxt'],
yhUI: {
importStyle: true,
buildTranspile: true,
prefix: 'Yh',
ssrOptimization: {
componentCache: true
}
}
})
Use Components Directly
<template>
<YhButton type="primary">Create</YhButton>
<YhInput v-model="keyword" clearable placeholder="Search" />
<YhTable :data="rows" :columns="columns" />
</template>
<script setup lang="ts">
const keyword = ref('')
const rows = ref([{ id: 1, name: 'YH-UI' }])
const columns = [{ prop: 'name', label: 'Name' }]
</script>
Module Options
| Option | Type | Default | Description |
|---|---|---|---|
importStyle |
boolean |
true |
Inject @yh-ui/components/style.css |
buildTranspile |
boolean |
true |
Add YH-UI packages to Nuxt transpile list |
prefix |
string |
'Yh' |
Component name prefix |
ssrOptimization.componentCache |
boolean |
true |
Enable SSR component cache hints |
License
MIT
Related Packages
nuxt-define
One utility function for module authors to define compiler constants for all bui...
13,412,511
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 1.0.63 | ^3.0 | MIT | |
| 1.0.62 | ^3.0 | MIT | |
| 1.0.61 | ^3.0 | MIT | |
| 1.0.60 | ^3.0 | MIT | |
| 1.0.59 | ^3.0 | MIT | |
| 1.0.58 | ^3.0 | MIT | |
| 1.0.57 | ^3.0 | MIT | |
| 1.0.56 | ^3.0 | MIT | |
| 1.0.55 | ^3.0 | MIT | |
| 1.0.54 | ^3.0 | MIT | |
| 1.0.53 | ^3.0 | MIT | |
| 1.0.52 | ^3.0 | MIT | |
| 1.0.51 | ^3.0 | MIT | |
| 1.0.50 | ^3.0 | MIT | |
| 1.0.49 | ^3.0 | MIT | |
| 1.0.48 | ^3.0 | MIT | |
| 1.0.47 | ^3.0 | MIT | |
| 1.0.46 | ^3.0 | MIT | |
| 1.0.45 | ^3.0 | MIT | |
| 1.0.44 | ^3.0 | MIT | |
| 1.0.43 | ^3.0 | MIT | |
| 1.0.42 | ^3.0 | MIT | |
| 1.0.39 | ^3.0 | MIT | |
| 1.0.38 | ^3.0 | MIT | |
| 1.0.37 | ^3.0 | MIT | |
| 1.0.36 | ^3.0 | MIT | |
| 1.0.30 | ^3.0 | MIT | |
| 1.0.26 | ^3.0 | MIT | |
| 1.0.25 | ^3.0 | MIT | |
| 1.0.24 | ^3.0 | MIT |
Showing the latest 30 of 89. See every release on npm