Full-stack-skills layui-vue3
Provides comprehensive guidance for Layui Vue component library including components, layer dialogs, and utilities. Use when the user asks about Layui Vue, needs to use Layui components in Vue 3, or implement UI components.
git clone https://github.com/partme-ai/full-stack-skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/partme-ai/full-stack-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/vue-ui-skills/layui-vue3" ~/.claude/skills/partme-ai-full-stack-skills-layui-vue3 && rm -rf "$T"
skills/vue-ui-skills/layui-vue3/SKILL.mdWhen to use this skill
Use this skill whenever the user wants to:
- Install and set up Layui Vue in a Vue 3 project
- Use Layui Vue components (Button, Table, DatePicker, etc.)
- Configure Layui Vue (theme, i18n, etc.)
- Use Layer component for modals and dialogs
- Implement forms with Layui Vue components
- Use data tables with sorting and pagination
- Handle file uploads
- Create dropdowns and tooltips
- Use date and time pickers
- Customize component styles
- Understand Layui Vue API and methods
- Troubleshoot Layui Vue issues
How to use this skill
-
Identify the topic from the user's request and find the corresponding example file in the mapping below
-
Load the appropriate example file from the
directoryexamples/ -
Follow the specific instructions in that example file for syntax, structure, and best practices
Doc mapping (one-to-one with https://www.layui-vue.com/zh-CN/)
Guide (指南):
→ https://www.layui-vue.com/zh-CN/indexexamples/getting-started.md
→ https://www.layui-vue.com/zh-CN/guide/introduceexamples/introduce.md
Components (组件) -
examples/components/:
-
See component files in
directoryexamples/components/ -
Each component file maps to https://www.layui-vue.com/zh-CN/components/[component-name]
Important Notes:
- Layui Vue is built for Vue 3
- Components use Composition API
- Supports TypeScript
- Examples include both JavaScript and TypeScript versions
- Each example file includes key concepts, code examples, and key points
-
Reference API documentation in the
directory when needed:api/
- Layer API methodsapi/layer-api.md
- Component API referenceapi/component-api.md
-
Use templates from the
directory:templates/
- Installation templatestemplates/installation.md
- Component usage templatestemplates/component-usage.md
1. Understanding Layui Vue
Layui Vue is a Vue 3 component library that provides a rich set of UI components, following the design philosophy of Layui.
Key Concepts:
- Vue 3 Support: Built with Vue 3 Composition API
- Rich Components: Button, Table, DatePicker, Layer, etc.
- TypeScript: Full TypeScript support
- Theme Customization: Support for theme customization
- i18n: Internationalization support
2. Installation
Using npm:
npm install @layui/layui-vue
Using yarn:
yarn add @layui/layui-vue
Using pnpm:
pnpm add @layui/layui-vue
3. Basic Setup
// main.js import { createApp } from 'vue' import LayuiVue from '@layui/layui-vue' import '@layui/layui-vue/lib/index.css' import App from './App.vue' const app = createApp(App) app.use(LayuiVue) app.mount('#app')
4. Basic Component Usage
<template> <lay-button type="primary">Button</lay-button> </template> <script setup> import { LayButton } from '@layui/layui-vue' </script>
Examples and Templates
This skill includes detailed examples organized to match the official documentation structure. All examples are in the
examples/ directory (see mapping above).
To use examples:
- Identify the topic from the user's request
- Load the appropriate example file from the mapping above
- Follow the instructions, syntax, and best practices in that file
- Adapt the code examples to your specific use case
To use templates:
- Reference templates in
directory for common scaffoldingtemplates/ - Adapt templates to your specific needs and coding style
API Reference
Detailed API documentation is available in the
api/ directory, organized to match the official Layui Vue API documentation structure:
Layer API (api/layer-api.md
)
api/layer-api.md
- Open modal/dialoglayer.open()
- Close layerlayer.close()
- Show messagelayer.msg()
- Show confirmation dialoglayer.confirm()
- Show loadinglayer.load()
- Show drawerlayer.drawer()
Component API (api/component-api.md
)
api/component-api.md- Component props and events
- Component methods
- Component slots
To use API reference:
- Identify the API you need help with
- Load the corresponding API file from the
directoryapi/ - Find the API signature, parameters, return type, and examples
- Reference the linked example files for detailed usage patterns
- All API files include links to relevant example files in the
directoryexamples/
Best Practices
- Use TypeScript: Take advantage of TypeScript support
- Import on demand: Import only needed components
- Follow component API: Use props and events correctly
- Customize theme: Use theme variables for customization
- Handle events: Properly handle component events
- Use Layer API: Use Layer API for modals and dialogs
Resources
- Official Documentation: https://www.layui-vue.com/zh-CN/index
- Getting Started: https://www.layui-vue.com/zh-CN/guide/introduce
- Components: https://www.layui-vue.com/zh-CN/components
- GitHub Repository: https://github.com/layui-vue/layui-vue
Keywords
Layui Vue, layui-vue, Vue 3, component library, UI components, Button, Table, DatePicker, Layer, Dropdown, Tooltip, Form, Input, Select, Checkbox, Radio, Switch, Upload, 组件库, 按钮, 表格, 日期选择器, 弹层, 下拉菜单, 提示, 表单, 输入框, 选择器, 复选框, 单选框, 开关, 上传