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

v-header

v1.0.0

Published

A Vue.js header component.

Downloads

2

Readme

v-header


移动端 Vue.js header 组件


Demo

Install

# install dependencies
npm i v-header -s
yarn add v-header

Usage

// 全局安装
import Vue from 'vue'
import Header from 'v-header'

Vue.use(Header) // 全局安装 默认组件名称 v-header

// 局部安装
import { Header } from 'v-header'

export default {
  name: 'App',
  components: {
    [Header.name]: Header // 局部安装 推荐使用该形式 使用组件默认名称
  }
}
<!-- app.vue -->
<template>
  <div id="app">
    <v-header title="这是标题"></v-header> <!-- 将组件放在顶部 -->
    <someThingYourComponents/>
  </div>
</template>

<script>
export default {
  name: 'App'
}
</script>

<style>

</style>

tips

  • 组件未实现fixed 功能需要你自行实现
  • 组件左侧slot在back=true时 显示后退icon 并且附带路由功能(在你安装vue-router的前提下)

实现思路

  1. 使用flex布局 将组件置于顶部 其余部分flex: 1
  2. 使用fixed布局 覆盖组件css

props

| name | desc | type | default | required | | :--: | :--: | ---: | :-----: | :------: | | title | 组件标题(可用slot自定义) | String | '' | false | | back | 点击left是否使用默认操作 | Boolean | true | false |


slot

| name | desc | info | | :--: | :--: | ---: | | default | title插槽 | 不传递会使用组件 title | | left | left插槽 | 当back(props)为true时默认显示后退icon | | right | right插槽 | null |


Event

| name | desc | param | | :--: | :--: | ---: | | click-left | 点击left触发(仅在back为false时触发) | null | | click-right | 点击right触发 | null | | click-title | 点击right触发 | null |


TODO


Github