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

vue-popup-layer

v0.0.18

Published

Mobile popup layer

Downloads

24

Readme

vue-popup-layer

This is a physical return component based on vue2.0. When writing H5 pages on the mobile terminal, you often only want to open a pop-up layer on the current page. Do not want to operate, click the physical return button in the upper left corner to return to the current page. That is always on the current page, the advantage of doing so is to keep the state of the data unchanged

Requirements

Vue.js 2.x

Installation

npm i vue-popup-layer -S

Usage

main.js:

import Vue from 'vue'
import PopupLayer from 'vue-popup-layer'
Vue.use(PopupLayer)
// If you don’t want to use the default name (historyState) for the local cache name, you can customize the storeName 
//Vue.use(PopupLayer, {
//  storeName: 'historyState', // default
// storeType:'localStorage' // The default is localStorage ,Only sessionStorage and localStorage and select 
//})

feature

  • visible : Whether to display the pop-up layer, its value is a Boolean
  • isAnimation: Whether transition animation effect is needed, its value is a Boolean value
  • zIndex: The level of the pop-up layer
  • extra: Attached data of the pop-up layer
  • autoIndex: Whether the pop-up layer is adaptive to the highest level of the page DOM, the priority is higher than the set zIndex
  • isAsync : Whether the component is loaded asynchronously
  • getContainer : Specifies the mount node, whose value can be a selection class name or a function

methods

  • onOpen:Callback function to open the popup layer
  • onClose:Callback function to close the popup layer
  • backLvBy:Return to the specified level by condition, the page level is 0

home:

codesandbox

<template>
  <div>
    <h1>home</h1>
    <button @click="layer.show1=true">Open the first shell </button>

    <!-- First shell  -->
    <popup-layer :visible.sync="layer.show1" @onOpen="open" @onClose="close">
      <h1>First shell </h1>
      <button @click="layer.show1=false">
        Close the first shell layer (you can also click the physical return button
      </button>
      <button @click="layer.show2=true">Open the second bomb layer </button>
    </popup-layer>

    <!-- Second bomb layer  -->
    <popup-layer :visible.sync="layer.show2">
      <h1>Second bomb layer </h1>
      <button @click="layer.show2=false">
        Close the second bomb layer (you can also click the physical return button)
        </van-button>
        <button @click="layer.show3=true">Open the third bomb layer </button>
      </button></popup-layer>

    <!-- Third bomb layer -->
    <popup-layer :visible.sync="layer.show3">
      <h1>Third bomb layer</h1>
      <button @click="layer.show3=false">
        Close the second bomb layer (you can also click the physical return button)
      </button>
    </popup-layer>
  </div>
</template>

<script>
export default {
  name: 'PopupLayerDemo',
  data () {
    return {
      layer: {
        show1: false,
        show2: false,
        show3: false
      }
    }
  },
  methods: {
    open () {
      console.log('The first bomb layer opened')
    },
    /**
     * @param {Boolean} isPopstate:Whether the close shell event comes from the physical return key
     */
    close ({ isPopstate }) {
      console.log(
        isPopstate ? 
        'Click the physical return button to close the first layer of bullets.' : 
        'Use other non-physical return key methods to close the first layer of bullets.')
    }
  }
}
</script>

update log

  • Fix the bug that the initial get ID is null (2022/1/26)
  • Add mount to the specified node property getContainer (2022/1/12)
  • Add a new feature isAsync to solve asynchronous loading of PopupLayer components (2021/12/23)
  • Added the backLvBy method to return to the specified layer by condition, the page level is 0 (2021/11/20)
  • Add elastic layer DOM adaptive z-index attribute autoIndex (2021/11/18)
  • Fixed the issue of returning invalid after opening multiple pop-up layers when refreshing the page (2021/11/17)
  • Added a new method closeLv that can close multiple bomb layers (2021/11/14)