@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 和依赖转译问题。

Nuxt Guide | GitHub

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
@lg2/nuxt3-module-create-dato-map

nuxt3-module-create-dato-map

2,869 0
nuxt-csurf

Nuxt Cross-Site Request Forgery (CSRF) Prevention

6,263,746 91
@bg-dev/nuxt-naiveui

Unofficial Naive UI module for Nuxt

144,316 187
@ztl-uwu/nuxt-content

Write your content inside your Nuxt app

34,108

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