npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@obdesign/nuxt

v0.1.1

Published

一个基于 Vue 3 和 Unocss 的组件库,包含 Unocss 预设

Downloads

25

Readme

@obdesign/nuxt

NPM Version

obdesign

一款基于 Vue 3 和 Unocss 的组件库,包含 Unocss 预设

:bulb: 组件库官网正在制作中,预览版本:o-b.design

快速入门

:bulb: 本文档面向 Nuxt 项目,且仅介绍安装过程,如果需要安装 Vite 项目的版本,或者需要详细的文档,请看 obdesign

1. 安装依赖

npm install @obdesign/nuxt

:information_source: 在此之前, 需要确保项目正确安装了unocss@unocss/reset。如果不知道如何安装,请您看这里 Unocss Vite PluginUnocss Browser Style Reset

2. 配置预设

// uno.config.ts
import { defineConfig, presetUno } from 'unocss'
import obPreset from '@obdesign/preset' // 这里和普通vite项目有所不同

export default defineConfig({
  content: {
    pipeline: {
      include: [
        // the default
        /\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/,
        // 编写提取文件路径(重要!)
        /.*\/ob\/.*\.(js|ts|vue|mjs|cjs)/,
      ],
    },
  },
  presets: [
    presetUno(),
    obPreset(), // 将预设添加到这里
  ],
})

3. 注册模块

:bulb: @obdesign/nuxt 支持单独引入、和模块自动导包

3.1 单独引入

<script setup lang="ts">
import { ObButton } from '@obdesign/components' // 这里和普通vite项目有所不同
</script>

<template>
  <ObButton>hello</ObButton>
</template>

3.2 模块自动导包(推荐)

// nuxt.config.ts
export default defineNuxtConfig({
  devtools: { enabled: true },
  // 注册模块
  modules: ['@unocss/nuxt', '@obdesign/nuxt'],
  // 为构建进行额外的编译
  build: { transpile: ['@obdesign/components'] },
  // 样式重置(无需另外导入其他重置文件)
  css: ['@unocss/reset/tailwind-compat.css'],
})

4. 使用组件

<template>
  <ObButton>按钮</ObButton>
  <ObLink>链接</ObLink>
  <ObSpin />
  ...
</template>