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

@south-rd/smarthub-file

v1.0.3

Published

图片文件VUE上传插件

Downloads

3

Readme

smart-file

本地项目初始化

yarn install

查看例子

yarn dev

组件打包

yarn run lib

基于 elementui,使用响应式处理元素 PC、手机样式

本地开发调试

本地项目 执行组件打包命令

yarn run lib

开启文件链接

yarn link

本地项目环境安装本组件

项目链接引用

yarn link @south-rd/smarthub-file

引入组件

import smarthubFile from '@south-rd/smarthub-file'
import '@south-rd/smarthub-file/lib/smarthub-file.css'
Vue.use(smarthubFile)

使用组件

组件名称

<smarthub-file></smarthub-file>

组件参数

defaultObj{
    action: "https://ssu.smarket.com.cn/v1/file/upload",//上传图片地址
    initUrl: "https://ssu.smarket.com.cn",//文件回显地址
    fileType: "",
    icon:'",
    type: "img", //img为方框上传图片,btn为按钮上传文件显示图片,file为按钮上传文件显示文件,drag拖拽上传
    title: "点击上传",//按钮上传中按钮文字
    text: "只能上传jpg/png文件,且不超过500kb",//按钮下面提示信息
    fileList: [//按钮上传图片回显
        name: "",
        url: "",
    ],
}
headers:{}//上传传请求头
disabled=""//是否禁用默认false
showList=""//是否展示列表默认true展示

触发事件

delImage(file, fileList){}//删除事件
onSuccess(response, imageUrl){}//上传成功触发

 <smarthubFile :defaultObj="defaultObj" :headers="headers" :onFileChange="onFileChange" ref="file"/>

 <script>
export default {
  name: "App",
  data() {
    return {
      defaultObj: {
        action: "https://ssu.smarket.com.cn/v1/file/upload",
        initUrl: "https://ssu.smarket.com.cn",
        type: "drag", //img为方框上传,imgbtn为按钮上传图片,file为上传文件,drag为拖拽上传
        title: "点击", //除了type=img其它必填
        text: "", //选填
        imageUrl: "", //必填
        fileList: [
          //type不为img的情况下必填回显使用的
          {
            name: "",
            url: "",
          },
        ], //回显
      },
      headers: {
        Authorization:
          "Bearer eyJhbGciOiJIUzI1NiJ9.MTYxNDkxNTAwOTQxODAwMTEwODMy.OkR0vLad0-EoMV1z6ZJ7M8hY7Kmd7WT8-CpWWscrYlA",
      },
    };
  },
  methods: {
    // onFileChange(file,defaObj) {//上传成功失败是触发
    //
    // },
     // clear() {//清空
    //   this.$refs["file"].clearFiles();
    // },
    //delImage(file, fileList){}//删除事件
    // onFileChange(file, defaultObj) {
    //   console.log("change", file, defaultObj);
    // },
    // onSuccess(response, imageUrl) {//上传成功的事件触发
    //   console.log(response, imageUrl);
    // },
  },
};
</script>