UI -- Vue3

Vue3 模板

Vue3 UI

  • package.json同级
  • components/slButton/element.vue
<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
import element from "./element.vue";
element.install = (app) => app.component(element.name, element);
export default element;
  • components/function.js
export const ceshi = ()=>{
   
    console.log('123')
}
  • components/index.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
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 文档

npm i vitepress -D
  • package.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
    • config.js
  • component
    • slbutton.md
  • get-started
    • index.md
  • guid
    • index.md
  • img
    • logo.ico
    • s.png
  • install
    • index.md
  • index.md

.vitepress

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

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

component

  • slbutton.md
  • \ 需去掉
# button


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

::: details 显示代码

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

:::

get-started

  • index.md
---
title: 快速上手
---

## 安装

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


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

guid

  • index.md
---
title: UI
---

# UI


 

👀 介绍

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

📌 项目特点

- UI

🔮 视觉稿

- UI

🚲 为什么叫   UI

- UI

install

  • index.md
  • \ 需去掉
---
title: 安装
---

# 安装

推荐安装  xxx@版本

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

或

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

index.md

---
layout: home


features:
- title: 简易好学
  icon: ⚡
  details: 基于 VUE3
- title: Vue 驱动
  icon: 🖖
  details: 享受 Vue 的开发体验,实践最流行的技术。
- title: s-ui
  icon: 🛠️
  details: s-ui
---

相关推荐

  1. UI -- Vue3

    2024-01-22 16:10:00       60 阅读
  2. ui_admin_vue3启动

    2024-01-22 16:10:00       34 阅读
  3. Vue3使用 xx UI解决布局高度自适应

    2024-01-22 16:10:00       70 阅读
  4. Element UI Plus + Vue3 给 Upload设置请求头

    2024-01-22 16:10:00       54 阅读
  5. UI 神器 - Vue3 中如何使用 element-plus

    2024-01-22 16:10:00       45 阅读
  6. uni-app + vue3项目引入unocss

    2024-01-22 16:10:00       22 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-22 16:10:00       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-22 16:10:00       106 阅读
  3. 在Django里面运行非项目文件

    2024-01-22 16:10:00       87 阅读
  4. Python语言-面向对象

    2024-01-22 16:10:00       96 阅读

热门阅读

  1. Linux内核--网络协议栈(九)epoll的源码实现

    2024-01-22 16:10:00       50 阅读
  2. Webpack5入门到原理22:提升打包构建速度

    2024-01-22 16:10:00       51 阅读
  3. 144.二叉树的前序遍历

    2024-01-22 16:10:00       43 阅读
  4. 如何在 Linux 服务器上设置定时任务?

    2024-01-22 16:10:00       58 阅读
  5. 解密神经网络:深入探究传播机制与学习过程

    2024-01-22 16:10:00       41 阅读
  6. leetcode-环形链表

    2024-01-22 16:10:00       63 阅读
  7. Hive之set参数大全-10

    2024-01-22 16:10:00       34 阅读
  8. MySQL——第一章 MySQL基础1

    2024-01-22 16:10:00       50 阅读
  9. 文字的力量

    2024-01-22 16:10:00       51 阅读