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

slash-auth-app

v1.1.7

Published

基于VUE3的模态框插件

Downloads

7

Readme

插件简介

基于VUE开发的模态框插件,支持常见的表单快速提交和图片预览等功能

效果

预览效果

img img img

项目特点

  1. 为了快速开发后台管理系统
  2. 后期适配移动端和指令式弹框

源码

github gitee

依赖

{
  "core-js": "^3.6.5",
  "vue": "^3.0.0",
  "axios": "^0.26.0",
  "less-loader": "^7.3.0",
  "@typescript-eslint/eslint-plugin": "^5.10.1",
  "@typescript-eslint/parser": "^5.10.1",
  "@vue/cli-plugin-babel": "^4.5.15",
  "@vue/cli-plugin-typescript": "^4.5.15",
  "@vue/cli-service": "~4.5.0",
  "@vue/compiler-sfc": "^3.2.29",
  "@vue/eslint-config-typescript": "^10.0.0",
  "babel-eslint": "^10.1.0",
  "docsify-cli": "^4.4.3",
  "eslint": "^8.7.0",
  "eslint-plugin-vue": "^8.4.0",
  "less": "^4.1.2",
  "typescript": "~4.5.5"
}

开发指南

详细参考手册请参考 暂时还没有

安装

npm install slash-layer

配置

配置文件(可参考详细配置这里只提供示例)

export const config = {
    title: "自定义全局标题",
    max: false,
    min: false,
    loadingTime: 200,
    successDecide(msg) {
        console.log(msg);
        if (msg.code == 200) {
            return {
                msg: msg.msg, result: true, data: msg.data
            }
        } else {
            return {
                msg: msg.msg, result: false, data: msg.data
            }
        }
    }
}
export default config;

main.js

import {createApp} from 'vue'
import App from './App.vue'
import SlashLayer from '../src/index.ts';
import {config} from './LayerConfig'
let app = createApp(App);
app.config.globalProperties.$systemName = '用户管理系统'
app.use(SlashLayer,config)
app.mount('#app')

调用示例

<template>
  <h2>
    模态框示例
  </h2>
  <el-button type="primary" @click="open()">无配置模态框</el-button>
  <el-button type="primary" @click="modal('sm')">预设SM尺寸模态框</el-button>
  <el-button type="primary" @click="modal('md')">预设MD尺寸模态框</el-button>
  <el-button type="primary" @click="modal('lg')">预设LG尺寸模态框</el-button>
  <el-button type="primary" @click="modal('full')">全屏模态框</el-button>

  <h2>
    提示框示例
  </h2>
  <el-button type="primary" @click="confirm">确认框</el-button>
  <el-button type="success" @click="success">成功</el-button>
  <el-button type="danger" @click="error">失败</el-button>
  <el-button type="info" @click="info">提示</el-button>
  <h2>
    表单
  </h2>
  <el-button type="primary" @click="createForm">创建表单</el-button>
  <el-button type="primary" @click="updateForm">更新表单</el-button>
  <el-button type="primary" @click="readForm">只读表单</el-button>
  <h2>其他</h2>
  <el-button type="primary" @click="images">图片</el-button>
</template>

<script>
import HelloWorld from "../components/HelloWorld"
import UserForm from "../components/UserForm"

export default {
  name: "GlobalConfigurationDemo",
  data(){
    return  {
      src: "../assets/1.jpg"
    }
  },
  methods: {
    open() {
      this.$layer.open({});
    },
    confirm() {
      this.$layer.confirm("您确定要删除么?").then((msg) => {
        alert("点击了确认按钮")
      }).catch((msg) => {
        alert("点击了取消按钮")
      })
    },
    modal(size) {
      this.$layer.modal({
        title: `${size}尺寸模态框示例`,
        position: size,
        content: {
          component: HelloWorld,
          parent: this,
          props: {
            msg: "参数传递"
          }
        }
      });
    },
    error() {
      this.$layer.error("我是错误提示信息");
    },
    success() {
      this.$layer.success("我是成功提示消息");
    },
    info() {
      this.$layer.info("我是普通提示消息");
    },
    createForm() {
      this.$layer.createForm({
        title: "创建用户",
        mask: true,
        content: {
          component: UserForm,
          props: {
            msg: "创建用户"
          }
        }
      });
    },
    updateForm() {
      this.$layer.updateForm({
        title: "更新用户",
        content: {
          component: UserForm,
          props: {
            msg: "更新用户"
          }
        }
      });
    },
    readForm() {
      this.$layer.readForm({
        title: "读取用户信息",
        content: {
          component: UserForm,
          props: {
            msg: "读取用户信息"
          }
        }
      });
    },
    images() {
      this.$layer.images({
        imgList:[
          {
            src:require("../assets/1.jpg")
          },
          {
            src:require("../assets/3.jpg")
          },
          {
            src:require("../assets/2.jpg")
          }
        ]
      });
    }
  }
}
</script>

<style scoped>

</style>