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

v1.0.6

Published

vue component config library

Downloads

8

Readme

Intro

Vue.js提供了组件化开发方式,对于页面开发变成一个个组件的组合。Vue不会对组件进行任何约束,这使得大家可以从上到下边想边写。这对于一个大的开发团队来说:1.代码复用性差 2. 开发前,没有设计,导致文件数量多,代码冗余 3. 开发效率低。

目前出现了很多iVew,ElementUI的组件库,但对于代码组织的vue库很少。我现在还没找到,如果你发现有,请issue我。

Demo

demo01

Documentation

broom 的基本思想是重新认识组件以及组件的组合方式。 组件: 页面上能够展示的一块区域。

  • 不依赖布局顺序,和父子,兄弟解耦
  • 明确声明的接口和属性,对数据具备良好的容错性
  • 对同级组件的通信配置

以标准的html组件radio为例

  1. 一个radio可以放在页面的任何位置,放在不同的父子之间和兄弟之间。
  2. 明确的value属性,
  3. 选择一个radio,与之同名的radio取消选择

配置数据交互

{
    "name": "pgc编目",
    "author": "lmz",
    "components":[
        {
            "component": "portal-tab",
            "model": "tab",
            "props": "showTab"
        },
        {
            "component": "portal-search",
            "out": "search_param"
        },
        {
            "component": "portal-loading",
            "in":["showLoading"]
        },
        {
            "component": "portal-videolist",
            "in": ["search_param"],
            "out": "showLoading"
        }
    ]

}

配置布局

{
    "name": "ugc编目",
    "author": "lmz",
    "components":[
        {
            "component": "portal-tab",
            "slot":["basic","advance"],
            "basic":{
                "components":[
                    {
                        "component": "portal-input",
                        "model": "file_name",
                        "rules": "required|maxCharLength:30",
                        "title": "标题",
                        "required": true,
                        "clazz": {
                            "input": "w330"
                        }
                    }
                ]
            },
            "advance":{
                "components":[
                    {
                        "component": "portal-radio",
                        "model": "rotate",
                        "title": "视频方向",
                        "contents": [
                            {"text":"自动识别","value":"1"},
                            {"text":"左转90度","value":"2"},
                            {"text":"右转90度","value":"3"},
                            {"text":"垂直翻转","value":"4"}
                        ]
                    }
                ]
            }
        }
    ]
}

Questions

为什么使用json,而不使用template

有两种考虑:

  1. 同为什么使用json,而不使用xml作为数据标准
  2. vue中操作json来render vnode更简单