跳到正文
Skillpedia
网站与界面(前端)9.5k · #12275

buefy

它能做什么

这项技能在智能体使用 Buefy 组件库编写 Vue 界面时提供指导。该组件库基于 Bulma 样式。适合构建 Vue 网页应用的开发者。

适用场景

  • ✓当你要编写包含按钮、表单、表格或弹出窗口的 Vue 页面时。
  • ✓当你的项目已将 Buefy 列为依赖项时。
  • ✓当你需要为 Vue 项目编写界面代码,而尚未选定界面库时。

技能链接

https://github.com/buefy/buefy/blob/main/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/buefy/buefy/blob/main/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请用 Buefy 字段、提交按钮和错误提示构建一个 Vue 联系表单。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会安装 Buefy;如果项目中已有它,则直接使用。然后它会编写 Vue 组件,使用该库现成的部件、属性和事件。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Buefy

Buefy is a lightweight UI component library for Vue 3 based on Bulma CSS. Components are Vue SFCs (<b-button>, <b-modal>, etc.) that wrap Bulma's class-based styles with reactive props, events, and slots.

When to run this skill

Trigger whenever you are:

  • Writing a Vue template or SFC that includes any UI element (buttons, forms, modals, tables, navigation, etc.)
  • Asked to "use Buefy" or "add a Buefy component"
  • Working in a project that has buefy in its package.json dependencies
  • Generating component code without a specified UI library in a Vue project

Install

npm install buefy

Full bundle (registers all components globally)

// main.ts
import { createApp } from 'vue'
import Buefy from 'buefy'
import 'buefy/dist/buefy.css'
import App from './App.vue'

const app = createApp(App)
app.use(Buefy)
app.mount('#app')

Individual components (tree-shakeable)

// main.ts — register as plugins
import { createApp } from 'vue'
import { Button, Field, Input } from 'buefy'
import App from './App.vue'

const app = createApp(App)
app.use(Button)
app.use(Field)
app.use(Input)
app.mount('#app')
<!-- Or import directly in a SFC -->
<script lang="ts">
import { BButton, BField, BInput } from 'buefy'
export default { components: { BButton, BField, BInput } }
</script>

Usage rules

  1. Use the type prop, not class — Buefy components expose Bulma modifiers as a type prop. Use type="is-primary" not class="is-primary" on Buefy components.
  2. Size prop values — "is-small" | "is-medium" | "is-large". No bare size strings.
  3. Always wrap form inputs in <b-field> — <b-field> provides the label, validation message, and grouping. Direct bare inputs miss label/message wiring.
  4. v-model target — Most components bind to modelValue. Named v-models on b-table: v-model:selected, v-model:checked-rows, v-model:current-page, v-model:opened-detailed.
  5. Icons — Use the icon prop with the icon name only (no mdi- prefix). The icon pack (MDI by default) must be registered in your project. Example: icon="home" not icon="mdi-home".
  6. b-table columns — <b-table> requires :data="arrayOfObjects" and <b-table-column field="key" label="Header"> children. Columns can also be passed via the :columns prop.
  7. Theming — Customize via Bulma SCSS variable overrides in a .scss file, not a JS config object. The ConfigProgrammatic utility sets defaults (icon pack, locale, etc.).
  8. Programmatic APIs — Components like Toast, Snackbar, Dialog, Loading, Modal, and Notification can be opened imperatively. Import the programmatic class or use the composable:
    import { ToastProgrammatic as Toast } from 'buefy'
    Toast.open('Hello world')
    // or with options:
    Toast.open({ message: 'Saved!', type: 'is-success', duration: 3000 })
    
    // Composable-style (preferred in Composition API):
    import { useToast } from 'buefy'
    const { open: openToast } = useToast()
    openToast({ message: 'Saved!', type: 'is-success' })
    

Colors & Types

Use these values for the type prop on components that accept it:

Value Meaning
is-primary Primary brand color (default blue)
is-link Link color
is-info Informational (cyan)
is-success Success (green)
is-warning Warning (yellow)
is-danger Error / danger (red)
is-dark Dark (near-black)
is-light Light (near-white)
is-white White
is-black Black

Size values: is-small · is-medium · is-large


Components

b-autocomplete

Autocomplete text input with dropdown suggestions.

Key props: v-model (String), data (Array — suggestion list), field (String — dot path into data objects for display), expanded, loading, icon, size, rounded, keep-first, open-on-focus, keep-open, clearable, placeholder

Slots: default (scoped: { option, index }) for custom option rendering; header, footer, empty, group

Emits: typing, select, focus, blur, infinite-scroll

<b-field label="Search">
  <b-autocomplete
    v-model="search"
    :data="filteredResults"
    field="name"
    placeholder="Type to search"
    @typing="onTyping"
    @select="onSelect"
  >
    <template #default="{ option }">
      {{ option.name }} — {{ option.category }}
    </template>
  </b-autocomplete>
</b-field>
常见问题

我需要先安装 Buefy 吗?

需要,除非你的项目中已经有它。这项技能会展示安装步骤以及如何注册组件。

它能与 Vue 3 配合使用吗?

可以。这项技能将 Buefy 描述为面向 Vue 3 的组件库。

我可以只使用部分组件吗?

可以。这项技能会展示如何单独导入各个组件,而不是导入完整的包。

详情

作者的原始描述

Official Buefy skill for Vue.js + Bulma UI components. TRIGGER when generating any Vue template, SFC, or component code that involves UI elements, forms, modals, tables, navigation, or feedback messages.

repo: buefy/buefy

热度

GitHub 星标
9.5k
排名
#12275
许可证
MIT
更新时间
2026/9/8

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

相似技能