UI -- Vue3

Vue3 模板

Vue3 UI

  • package.json同级
  • components/slButton/element.vue
js 复制代码
<template>
    <div class="dddiv"><span>测试321</span></div>
</template>

<script setup>
    defineOptions({
    name: "sl-button"
});
</script>

<style scoped>
    .dddiv span{
    color: red;
}
</style>  
  • components/slButton/index.js
js 复制代码
import element from "./element.vue";
element.install = (app) => app.component(element.name, element);
export default element;
  • components/function.js
js 复制代码
export const ceshi = ()=>{
    console.log('123')
}
  • components/index.js
js 复制代码
import slButton from "./slButton/index"
import {ceshi} from "./function"

const components = [slButton];

const install = (app, opts = {}) => {
    components.forEach((component) => {
        app.use(component);
    });
    app.config.globalProperties.$ceshi = ceshi;
};

const Sl = {
    install,
    slButton
};

export { slButton, install };
export default Sl;

使用

  • main.js
js 复制代码
import Sl from '../components/index'
// 打包使用需要引入css
createApp(App).use(SL).mount('#app');


<sl-button></sl-button>

import { getCurrentInstance } from "vue";
const { appContext } = getCurrentInstance();
appContext.config.globalProperties.$ceshi();

UI 文档

bash 复制代码
npm i vitepress -D
  • package.json
json 复制代码
"scripts": {
    "docs:dev": "vitepress dev docs",
    "docs:build": "vitepress build docs",
    "docs:serve": "vitepress serve docs"
  }
  • package.json 同级
  • docs 创建

docs 目录结构

.vitepress

  • theme/index.js
js 复制代码
import DefaultTheme from "vitepress/theme";
import Sll from "../../../components/index";
// 引入打包之后的需要css

export default {
    ...DefaultTheme,
    enhanceApp: async ({ app }) => {
        app.use(Sll);
    },
};

component

md 复制代码
# button


<ClientOnly>
<sl-button></sl-button>
</ClientOnly>

::: details 显示代码

\```html
<sl-button></sl-button>
\```

:::

get-started

md 复制代码
---
title: 快速上手
---

## 安装

请参考 [安装](../install/) 章节


## 单个引入
 
## 全局引入
 

guid

md 复制代码
---
title: UI
---

# UI


 

👀 介绍

- 本 UI 框架是基于 Vue3 实现的。

📌 项目特点

- UI

🔮 视觉稿

- UI

🚲 为什么叫   UI

- UI

install

md 复制代码
---
title: 安装
---

# 安装

推荐安装  xxx@版本

\```bash
npm install xxx@版本
\```

或

\```bash
yarn add xxx@版本
\```

index.md

md 复制代码
---
layout: home


features:
- title: 简易好学
  icon: ⚡
  details: 基于 VUE3
- title: Vue 驱动
  icon: 🖖
  details: 享受 Vue 的开发体验,实践最流行的技术。
- title: s-ui
  icon: 🛠️
  details: s-ui
---
相关推荐
EaseUI9 小时前
【Ease UI】2026-04-24 项目更新:增加多种风格登录页,增加菜单风格切换
ui
MXN_小南学前端12 小时前
watch详解:与computed 对比以及 Vue2 / Vue3 区别
前端·javascript·vue.js
2601_9498146912 小时前
Docker部署Spring Boot + Vue项目
vue.js·spring boot·docker
Lkstar14 小时前
逐步搞懂 Vue 的 patchChildren,把 Diff 算法拆给你看
vue.js
ZC跨境爬虫15 小时前
UI前端美化技能提升日志day7:(原生苹方字体全局适配+合规页脚完整像素级落地)
前端·javascript·ui·html·交互
nbsaas-boot16 小时前
100万门店级分货系统架构设计
前端·javascript·vue.js
笋笋~17 小时前
el-tree 拖拽事件隔离:实现句柄独立控制,区域分离
javascript·vue.js·elementui
前端那点事17 小时前
Vue生命周期速查:Vue2+Vue3钩子全解析,新手也能秒懂
前端·vue.js
Ulyanov18 小时前
《PySide6 GUI开发指南:QML核心与实践》 第十篇:综合实战——构建完整的跨平台个人管理应用
开发语言·python·qt·ui·交互·qml·雷达电子战系统仿真
Aotman_18 小时前
Element UI 表格搜索高亮
前端·javascript·vue.js·ui·elementui