19 Star 373 Fork 45

undraw / undraw-ui

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Undraw UI - A Vue.js 3 UI library

🔥功能

折叠、评论、锚点、搜索

  1. 折叠

  1. 评论

暗黑主题

img

  1. 搜索(input关键词动态滚动)

  1. 锚点

入门

请遵循https://undraw.gitee.io/undraw-ui/上的文档!

地址

安装

使用npm安装

vue低于3.2.25可能无法正常使用 可选依赖:使用element-plus低于2.1.8会出现input样式冲突

npm i undraw-ui@1.0.7

使用

  1. main.ts 中引入组件
import { createApp } from 'vue'
import App from './App.vue'

import UndrawUi from 'undraw-ui'
import 'undraw-ui/dist/style.css'

const app = createApp(App)
app.use(UndrawUi)
app.mount('#app')
  1. App.vue中使用

(1)下载表情包资源emoji.zip下载
(2)static文件放在public下,引入emoji.ts文件可以移动assets下引入,也可以自定义到指定位置
(3)js实例地址comment-js.vue

<template>
  <u-comment :config="config" @submit="submit">
    <!-- <template>导航栏卡槽</template> -->
    <!-- <template #header>头部卡槽</template> -->
    <!-- <template #info>信息卡槽</template> -->
    <!-- <template #card>用户信息卡片卡槽</template> -->
    <!-- <template #func>功能区域卡槽</template> -->
  </u-comment>
</template>

<script setup lang="ts">
// 下载表情包资源emoji.zip https://gitee.com/undraw/undraw-ui/releases/tag/v0.0.0
// static文件放在public下,引入emoji.ts文件可以移动assets下引入,也可以自定义到指定位置
import emoji from './emoji'
import { reactive } from 'vue'
import { CommentApi, ConfigApi, SubmitParamApi, UToast } from 'undraw-ui'

defineOptions({
  name: 'comment'
})

const config = reactive<ConfigApi>({
  user: {} as any,
  emoji: emoji,
  comments: [],
  showLevel: false,
  showHomeLink: false,
  showAddress: false,
  showLikes: false
})

// 评论数据
setTimeout(() => {
  config.user = {
    id: 1,
    username: 'jack',
    avatar: 'https://static.juzicon.com/avatars/avatar-200602130320-HMR2.jpeg?x-oss-process=image/resize,w_100'
  }
  config.comments = [
    {
      id: '1',
      parentId: null,
      uid: '1',
      content: '等闲识得东风面,万紫千红总是春。',
      createTime: '2023-04-30 16:22',
      user: {
        username: '团团喵喵',
        avatar: 'https://static.juzicon.com/user/avatar-23ac4bfe-ae93-4e0b-9f13-f22f22c7fc12-221001003441-Y0MB.jpeg'
      }
    },
    {
      id: '2',
      parentId: null,
      uid: '2',
      content: '长风破浪会有时,直挂云帆济沧海。',
      createTime: '2023-04-28 09:00',
      user: {
        username: '且美且独立',
        avatar: 'https://static.juzicon.com/avatars/avatar-20200926115919-a45y.jpeg'
      }
    }
  ]
}, 500)

// 评论提交事件
let temp_id = 100
// 提交评论事件
const submit = ({ content, parentId, files, finish }: SubmitParamApi) => {
  console.log('提交评论: ' + content, parentId, files)

  const comment: CommentApi = {
    id: String((temp_id += 1)),
    parentId: parentId,
    uid: config.user.id,
    content: content,
    createTime: '1分钟前',
    user: {
      username: config.user.username,
      avatar: config.user.avatar
    },
    reply: null
  }
  setTimeout(() => {
    finish(comment)
    UToast({ message: '评论成功!', type: 'info' })
  }, 200)
}
</script>

开发交流

QQ群:undraw(682265529)

MIT License Copyright (c) 2023 readpage Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

vue评论组件,🔥基于vue3的UI组件,主要功能有评论,聊天,搜索,锚点。你的⭐️Star ,是作者开发的动力! 展开 收起
TypeScript 等 5 种语言
MIT
取消

发行版 (5)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
TypeScript
1
https://gitee.com/undraw/undraw-ui.git
git@gitee.com:undraw/undraw-ui.git
undraw
undraw-ui
undraw-ui
master

搜索帮助