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 🙏

© 2025 – Pkg Stats / Ryan Hefner

inmind

v1.0.0

Published

## 关于

Downloads

4

Readme

lan-vue

关于

Web整体架构方案(Vue版本)

如何运行lan-vue

  • 克隆kil到本地 git clone https://github.com/lovelypig5/kil.git

  • 进入kil文件夹安装dependencies npm install -g 或者 本地安装再在全局link到kil的node_modules目录

  • 在lan-vue项目文件夹下安装dependencies npm instsall

  • 启动 kil dev

Vuex

###使用步骤介绍

  • 项目中使用vuex氛围五个步骤,具体介绍如下

    1. entrance: 在入口文件中编入store
    2. store: 控制中心中引入各个数据模块
    3. module: 定义模块的数据操作
    4. actions: 统一动作声明和dispatch
    5. view: 界面触发action
  • entrance: 在入口文件中编入store

js/main.js

import store from './vuex/store'

#...


let VueParam = {
    el: '#body',
    store
};

# ...

router.start(VueParam);

  • store: 控制中心中引入各个数据模块

js/vuex/store.js

import Vue from 'vue'
import Vuex from 'vuex'
import welcome from './components/welcome'

Vue.use(Vuex)

export default new Vuex.Store({
    modules: {
        welcome
    }
})

各个模块的数据操作被被分别定义在了components下的各个文件中

  • module: 定义模块的数据操作

js/vuex/components/welcome.js

const state = {
    profile: {'name': 'Kimi', 'age': 31, 'gender': 'male'} 
}

const mutations = {
    UPDATE_PROFILE (state, profile) {
        state.profile = Object.assign(state.profile, profile);
    }
}

export default {
    state,
    mutations
}
  • actions: 统一动作声明和dispatch

js/vuex/actions.js

export const updateProfile = makeAction('UPDATE_PROFILE')

function makeAction(type) {
    return ({dispatch}, ...args) => dispatch(type, ...args);
}

所有数据的操作都在具体的模块(vuex/components)中,但需要统一在actions中定义动作用来做dispatch。

  • view: 界面触发action

components/welcome.vue

<template>
	<input @change="tryUpdateAge" v-model="profile.age"></input>
</template>

components/welcome.vue

\<script type="text/javascript">

import { updateProfile } from '../js/vuex/actions'

export default {
    vuex: {
        getters: {
            profile: ({welcome}) => welcome.profile
        },
        actions: { // act as setters
            updateProfile
        }
    },
	#...
    methods: {
        tryUpdateAge(e) {
            const value = e.target.value.trim();
            if(value && !isNaN(parseInt(value))) {
                this.updateProfile({'age': parseInt(value)});
            }
        }
    }
}
</script>

从import 从actions引入对应操作。

getters: 数据获取可以直接把数据模块作为参数传入到getter模块即可用

setters: 必须通过actions中的方法调用,最终触发到welcome数据模块中操作完成写

Components

directives