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

@liuyunxi/upload-vod

v1.0.0

Published

腾讯云点播上传 vue3+ts

Downloads

1

Readme

腾讯云点播上传

限制上传数量 限制上传格式 限制上传大小 显示上传进度 断点续传

代码演示

<template>
  <AButton @click="ok" style="margin-bottom: 10px">打印文件上传结果</AButton>
  <YxVodUpload
      v-model:value="fileList"
      :signature="signature"
      rootUrl="http://127.0.0.1:8080"
      :headers="getHeaders"
      :max="5"
      :size="50000"
  ></YxVodUpload>
</template>

<script setup lang="ts">
/**
 * 视频: .mp4,.avi,.mpeg
 */
import { ref } from 'vue'
const signature = 'http://localhost:8010/file/v1/tx/vod/signature'
const fileList = ref([
  {
    fileId: '243791577886541835',
    name: 'xx视频',
    url: '//1500017108.vod2.myqcloud.com/6cad6439vodcq1500017108/260d7322243791577886541835/Wk1OT4igLfMA.mp4',
  },
])
const ok = () => {
  console.log(fileList.value)
  console.log(JSON.stringify(fileList.value))
}
/**
 * 获取请求头
 */
const getHeaders = () => {
  return {
    'Cache-Id':
        'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYXlsb2FkIjp7ImZyZXNoVGltZSI6MTY4MjE1NDUxNCwiaW5mbyI6IntcImF2YXRhclwiOlwie1xcXCJ1cmxcXFwiOiBudWxsLCBcXFwibmFtZVxcXCI6IFxcXCJjcm9wcGVkLTE2NzYzMzkzNzM3MTcucG5nXFxcIiwgXFxcInBhdGhcXFwiOiBcXFwiXFxcXFxcXFxkZXZcXFxcXFxcXDIwMjMwMjE0XFxcXFxcXFxhYjhhMjI5ZjM3YmQ0MmUzODg0YjhiNmVlMTI5ZmNkYy5wbmdcXFwiLCBcXFwic2l6ZVxcXCI6IG51bGwsIFxcXCJzdWZmaXhcXFwiOiBcXFwicG5nXFxcIn1cIixcImVtYWlsXCI6XCJcIixcImlkXCI6XCIyOGMxMTQ2NC0zZTY3LTRhNGEtYjI1MC04YzQyMjZhNzAxNDhcIixcImxvZ2luSXBcIjpcIjE5Mi4xNjguMzEuMTg4XCIsXCJsb2dpbk5hbWVcIjpcImFkbWluXCIsXCJsb2dpblRpbWVTdHJcIjpcIjIwMjMtMDQtMTkgMTY6NThcIixcInBob25lTnVtYmVyXCI6XCIxNzMzNTc3ODY4NVwiLFwicm9sZXNcIjpbXCLnrqHnkIblkZhcIl0sXCJzZXhcIjpcIlwiLFwidGVuYW50SWRcIjpcImZhMzY5ZTE5LTI2NDgtNGNkYy1hOGUzLWQwMDEyODgwMmRlYVwiLFwidXNlck5hbWVcIjpcIuW5s-WPsOWFrOWPuOi2heeuoVwifSJ9LCJleHAiOjE2ODIwNzE3MTR9.fv_VHuCy3aQ0MFdsiS3X3aHmOcI8qeRmSQN8ezt-AxE',
  }
}
setTimeout(() => {
  fileList.value = [
    {
      fileId: '243791577886541835',
      name: 'xx视频',
      url: '//1500017108.vod2.myqcloud.com/6cad6439vodcq1500017108/260d7322243791577886541835/Wk1OT4igLfMA.mp4',
    },
  ]
}, 1000)
</script>

<style scoped lang="less"></style>

API

参数

| 参数 | 说明 | 类型 | 默认值 | |---------------|----------------|:--------:|------| | v-model:value | 绑定数据 | Array | [] | | action | 上传地址 | string | | | rootUrl | 文件访问跟地址 | string | | | headers | 请求头 | Function | | | accept | 允许格式(详见demo) | string | | | max | 最大数量限制 | number | 5 | | size | 最大大小限制 单位M | number | 200 | | showUpload | 是否显示上传按钮 | boolean | true | | showDelete | 是否显示删除按钮 | boolean | true |

事件

| 事件名称 | 说明 | 回调参数 | |--------|------|-------------------| | change | fileList | function({fileList:[]}) |