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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@youngsdream/exposure

v0.1.0

Published

[在线操作示例](https://IVANLEE99.github.io/youngsdream-vue-directive/index.html)

Readme

在线操作示例

v-exposure

1、安装

npm install @youngsdream/exposure

2、手动注册导入

import { vExposure } from '@youngsdream/exposure'
directives: {
    exposure: vExposure
},

3、全局注册

import ExposureDirective from "@youngsdream/exposure";

Vue.use(ExposureDirective);

4、使用

      <h2 style="margin-top: 100vh">v-exposure 曝光指令演示</h2>
      <div
        style="height: 200px; background: #f0f0f0"
        class="demo"
        v-exposure="{ data: 'test', fn: fn }"
      >
        <div>测试曝光指令 arg 默认0.5</div>
        <div>v-exposure="{ data: 'test', fn: fn }"</div>
        <span v-if="isExposure1" style="color: red">已曝光</span>
      </div>
      <div
        style="height: 200px; background: #f0f0ff"
        class="demo"
        v-exposure:1="{ data: 'test2', fn: fn }"
      >
        <div>测试曝光指令 arg 1</div>
        <div>v-exposure:1="{ data: 'test2', fn: fn }"</div>
        <span v-if="isExposure2" style="color: red">已曝光</span>
      </div>
      <div
        style="height: 200px; background: #f0ffff"
        class="demo"
        v-exposure:[0.8].always="{ data: 'test3', fn: fn }"
      >
        <div>测试曝光指令 arg 0.8 一直触发</div>
        <div>v-exposure:[0.8].always="{ data: 'test3', fn: fn }"</div>
        <span v-if="isExposure3" style="color: red"
          >已曝光{{ exposure3Time }}次</span
        >
      </div>

5、参数

v-exposure:arg={ data: 'test', fn: fn }

| 参数 | 说明 | 类型 | 默认值 |备注 | | --- | --- | --- | --- |---| | arg | 阈值 | number | 0.5 | 曝光阈值 | | data | 透传数据 | any | - | 透传给回调函数的数据 | | fn | 回调函数 | function | - | 曝光时触发的回调函数