npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tino-design-ui

v0.2.10

Published

Tino Design UI: A Vue.js 3 UI Library

Downloads

11

Readme

Tino-Design-UI

这是一个vue3的UI框架,官网在努力制作中。

目前,已经上线的组件已经有四个:SpaceAdaptiveInputAdaptiveTextareaUpload。 官方文档暂定:文档链接,目前此文档仅支持可以适配ipv6的设备使用。

一、安装

# npm
npm install tino-design-ui

# yarn
yarn add tino-design-ui

二、使用

// 加载所有组件
import UiComponents from 'tino-design-ui'
app.use(UiComponents)

// 按需加载 【推荐】
import { Upload } from 'tino-design-ui'
app.component(Upload.name, Upload)

三、版本更新内容

v0.2.1

Upload 完整版上传控件正式上线

1、基本使用

<script lang="ts" setup>
import { Upload as TUpload } from 'tino-design-ui'
</script>

<template>
  <t-upload :files="[]" url="http://localhost:3000/upload" />
</template>

2、自定义上传

<script lang="ts" setup>
import axios from 'axios'
import { Upload as TUpload } from 'tino-design-ui'

const customRequest = async (options: UploadRequestOptions) => {
  const { name, file, progressEvent, successEvent, errorEvent } = options

  const formData = new FormData()
  formData.append(name, file)
  try {
    const response = await axios.post('http://localhost/upload', formData, { onUploadProgress: (event) => progressEvent(event as any) })
    successEvent(response.data)
  } catch (err) {
    errorEvent({ status: (err as any).response.status, errmsg: (err as any).response.statusText })
  }
}

</script>

<template>
  <t-upload
    :files="[]"
    :customRequest="customRequest"
  />
</template>

3、手动上传

<script lang="ts" setup>
import { ref } from 'vue'

const Upload = ref()
</script>

<template>
  <t-upload
    :files="[]"
    :auto-upload="false"
    ref="Upload"
    url="http://localhost:3000/upload"
  />
  <button @click="Upload!.upload()">点击上传</button>
</template>

4、更多api

export interface Upload {
  /**
   * 自定义类名前缀
   */
  customClassPrefix?: string
  /**
   * 限制上传的文件数量
   */
  limit?: number
  /**
   * 上传之前的钩子函数
   */
  beforeUpload?: (files: FileList) => boolean
  /**
   * 上传地址
   */
  url?: string
  /**
   * 自定义上传
   */
  customRequest?: (options: UploadRequestOptions) => { abort: () => void }
  /**
   * 文件列表
   */
  files: UploadFile[]
  /**
   * 上传的字段名
   */
  name?: string
  /**
   * 上传按钮以何种形式展示
   */
  type?: 'button' | 'card'
  /**
   * 限制上传的文件格式
   */
   accept?: string
   /**
    * 是否允许拖拽上传,仅在type值为card时有效
    */
   draggable?: boolean
   /**
   * 是否显示文件列表
   */
  showFileList?: boolean
  /**
   * 是否在文件准备就绪后立即上传
   */
   autoUpload?: boolean
   /**
    * 上传按钮文本,仅type类型为button生效
    */
  btnText?: string
  /**
   * 卡片面板提示词,仅type类型为card生效
   */
  cardDescription?: string
}