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

@jdorg/jmoremsg

v0.1.5

Published

一个基于vue的“更多信息”的单个组件

Downloads

4

Readme

jmoremsg

  • 一个基于vue的“更多信息”的单个组件
  • 根据包裹组件所在位置自动调整显示位置
  • 默认显示位置为right-bottom, 距离鼠标指针 [ 3px, 3px ], 请注意,该默认位置并未提供修改prop

setup

npm install @jdorg/jmoremsg --save

import JDMoremsg from '@jdorg/jmoremsg'

Vue.use(JDMoremsg) 

Props

|props|描述|备注| |---|---|---| |text|设置文本|none| |setup|设置基本属性|none| |follow|设置跟随性质|none|

text

该prop用来设置要显示的更多信息

@Prop({default: ''}) private text?:string;

setup

该prop用来设置一些基本属性

@Prop() private setup?:Setup;

interface Setup {
  duration?:number; // 隔多久显示
  width?:string; // 宽度, 与css属性一致
  height?:string; // 高度, 与css属性一致
  background?:string; // 背景, 与css属性一致
}

默认值:

private defaultSetup:Setup = {
  duration: 2000,
  width: 'auto',
  height: 'auto',
  background: '#fff'
}

follow

该prop用来设置此组件的跟随性质,默认为空字符串

@Prop({default: ''}) private follow?:string;

|可选值|状态|备注| |---|---|---| |'follow'|鼠标在组件内部移动时moremsg会跟随移动,当mouseleave时消失|none| |'none'|鼠标在组件内移动时mroemsg会马上消失|none| |''|鼠标在组件内部移动时moremsg不会消失,当mouseleave时消失|default|

Slots

default

要让鼠标在上面经过duration显示moremsg包裹的内容

<slot></slot>

custom

可自定义显示内容,如果此slot和名为text的prop同时存在,此slot会显示在text上方

<slot name="custom"></slot>
<div class="more-msg-text">{{ text }}</div> <!--如上所言, text是在名为custom的slot下方定义的-->

example

<jmoremsg 
text="This is more message" 
:setup="{ background:'#ddd' }"
follow="follow"
>
  <img class="img" slot="custom" src="./assets/imgs/header.jpg" alt="img">
  <button class="btn">This is a button in default slot</button>
</jmoremsg>
.btn {
  height: 100px;
}
.img {
  width: 300px;
}

example

others

@jdorg是一个开源前端组件的社区,如果你有开源组件的想法,欢迎加入我们

qqgroup