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-documentation

v0.2.2

Published

Vue component documentation made simple.

Downloads

12

Readme

vue-documentation

Vue component documentation made simple.

Usage

import Vue from 'vue'
import VueDocs from 'vue-documentation'
Vue.use(VueDocs)
<vue-doc :component="myComponent"/>
<vue-doc-library :components="myComponentsObject" />

Writing Documentation

Similar to the (now archived) propdoc package, vue-doc parses a number of new properties (all optional) from the Vue component definition. Here's a complete example of the new properties:

export default {
  name: 'component-name',
  deprecated: false,
  introduction: 'A short blurb about the component',
  description: 'A more thorough description of the component and what it does.',
  sample: '<component-name :foo="bar" />', // renders within a <code></code> block
  props: {
    foo: {
      type: String,
      required: true,
      note: 'Please always pass either "bar" or "baz" here.', // Renders as HTML
    }
  },
  events: {
    'some-event': {
      type: Object, // the type of the event payload
      node: 'A description of the event and when it emits', // Renders as HTML
    }
  }
}

Dealing With Slots And Sample Values

Documentation should live within components, but to demonstrate a component in the sandbox, you may need to pass some sample values or slots which can't be distributed with your components.

With vue-documentation, sample prop values can be passed like so:

<vue-doc :component="button-redirect" :props="{
  location: '/some/redirect/url',
  querystring: {foo: 'bar'}
}">

You can also pass slot content directly to a <vue-doc> component. The default slot should be assigned to the default key.

<vue-doc :component="button-icon" :slots="{
  default: `Click Me`,
  icon: `<img src="/path/to/some/icon.png"/>`,
}" />

If using the vue-doc-library component, these supplementary values can be passed in via the :docs prop which accepts an object with the following shape:

const docs = {
  'button-redirect': {
    props: {
      location: '/some/redirect/url',
      querystring: {foo: 'bar'},
    }
  },
  'button-icon': {
    slots: {
      default: 'Click Me',
      icon: `<img src="/path/to/some/icon.png"/>`,
    },
  },
}

Development

Contributions welcome!