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

v0.0.6

Published

**[中文版本](https://github.com/wangkai1995/vue-mini/blob/master/README-ch.md)**

Downloads

11

Readme

Vue-mini

中文版本

This is one for learning! Mini MVVM Library Based on Vue. Js
  • About vue-mini: This is a mini framework based on Vue. Js: MVVM,
    • Only the core MVVM syntax sugar V-model, vnode and so on. Ps: version 0.0.0 does not add diff patch,
    • Change the DOM event binding to: for example @ Click to vm-onclick,
    • Some common directives include:: { v-if=vm-if, v-class=vm-class, v-for=vm-for, v-show=vm-show, v-model=vm-model }
    • V-bind mode re-modify for example (class="container" :class="testClass") => (class="container {{testClass}}" );
    • Lifecycle reserved mounted, updated,
    • All other features are removed and the compressed size is 17KB, which I currently use in WebView activity H5
  • Compatibility and support: to vue.js

Installation

npm install vue-mini

Examples

html:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8"/>
		<meta name="viewport" content="width=device-width,height=device-height, user-scalable=no,initial-scale=1, minimum-scale=1, maximum-scale=1,target-densitydpi=device-dpi ">  
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
		<meta name="renderer" content="webkit">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<title>vue-mini</title>
		<style>
			.item{
				padding:5px;
			}
			.test{
				font-size: 20px;
				margin-top: 20px;
				display: inline-block;
			}
			.active{
				color:#f30;
			}
		</style>
	</head>
	<body>

		<div id="test">
			<h5     
				style="color:#f50;font-size:16px;" 
				vm-onClick="testClick"
			>
				Click on me to get the current time:{{time}}
			</h5>
			<p 
				style="color:#f50;font-size:16px" 
				vm-show="false"
			>
				Used to test vm-show
			</p>
			His Name: {{name}}<br>
			<span 
				class="test" 
				vm-class="{'active':testShow}"
			>
				This year's age is{{age}}
			</span>
			<p>
				<input type="text" vm-model="name" />
			</p>
			<p  vm-if="testShow">It's a boy.</p>
			<div 
				vm-for="item in family" 
				class="item"
			>
				Family name is:{{item.name}},<span>The relationship is{{item.relation}} </span>
			</div>
		</div>
	</body>
</html>

js:

import VueMini from 'vue-mini';

window.onload = function() {
    var family = [{
        relation: 'Father',
        name: 'old wang'
    }, {
        relation: 'Mother1',
        name: 'old li 2'
    }, {
        relation: 'Mother2',
        name: 'old li 3'
    }, {
        relation: 'Mother3',
        name: 'old li 4'
    }, {
        relation: 'Mother4',
        name: 'old li 5'
    }, {
        relation: 'Mother5',
        name: 'old li 6'
    }, ]

    var test = new VueMini({
        el: '#test',
        data: {
            name: 'Adi Wang',
            age: 17,
            testShow: false,
            time: new Date().toLocaleString(),
            family: family,
        },
        method: {
            testClick: function(el) {
                console.log('Click on the test method, click on the element attribute as', el)
                test.time = new Date().toLocaleString();
            }
        }
    })
    
    test.testClick();
    
    var time = setInterval(function() {
        test.age += 1;
        test.testShow = !test.testShow;
        if (test.age < 20) {
            test.family.splice(4, 0, {
                relation: 'aaaa',
                name: 'ooooo'
            });
        }
        if (test.age > 20 && test.age < 22) {
            test.family.splice(2, 0, {
                relation: 'yesyes',
                name: 'nono'
            });
        }
    }, 1000)
}