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

hg-vue-login

v1.0.3

Published

This is a login plugin about Vue

Downloads

4

Readme

This is a login plugin about Vue

介绍

这是一个在学习Vue的过程中做的一个登录插件,希望对你有用。

开始使用

vue2中的使用方式

/**
    * 在这里可以处理插件与实例之间的通信
    * @param container  String  挂载插件的接口类名称
    * @param withCookie Boolean 是否携带cookie
    * @param onLogin    function  登录成功后返回的数据
    * @param onLogout   function  注销登录后返回的数据 (默认没有返回值)
    * @param onLoginError  function  登录失败后返回的数据 (如:网络失败,账号密码失败)
    * */

 this.$createMyInstance({
    container:'.login-box',
    withCookie: true,
    onLogin:(preload)=>{
        console.log('--------AUTH_EVENT_LOGIN--------', preload,this);

    },
    onLogout:(preload)=>{
        console.log('--------AUTH_EVENT_LOGOUT--------',preload,this);

    },
    onLoginError:(preload)=>{
        console.log('--------AUTH_EVENT_LOGIN_ERROR--------',preload, this);
    },
})

触发事件监听函数,组件内部自定义事件函数

 /**
     * function on_Login  @param {on-login}   eg:$on('on-login')
     * function on_Logout @param {on-login-error} eg:$on('on-login-error')
     * function on_LoginError @param {on-log-out} eg:$on('on-log-out')
     *
     * 监听插件内部事件
     * 根据参数添加额外的逻辑
     * */
    this.loginInstance.$on('login-event',userData=>{
        console.log("login success!",userData)
    })

vue3的使用目前之前LoginPlugin组件注册,不支持通过自定义节点挂载,后续会优化成vue2、vue3都兼容自定义挂载

·

 Vue.component('LoginPlugin', Login);

 <template>
 <LoginPlugin></LoginPlugin>
</template>

文档

提问

变更记录

联系方式

共享代码

作者:HLR