Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

simple vue plugin to implement underscore

License

NotificationsYou must be signed in to change notification settings

HKskn/vue-underscore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

You know Underscore.js is a utility-belt library for JavaScript that provides support for the usual functional suspects (each, map, reduce, filter...) without extending any core JavaScript objects.I arranged it as a vue plugin to use on your projects.

VersionPackagist

Table of Contents

Requirements

Installation

# npm$ npm install vue-underscore

Usage

After using the plugin on main.js. You can call it simply with 'this.$_.findwhere' (each, map, reduce, filter...)

main.js

importVuefrom'vue';importunderscorefrom'vue-underscore';importAppfrom'./App';Vue.use(underscore);newVue({  ...App}).$mount('#app');

If you wouldn't like to access from vue prototype, you can add underscore on the component source code directly via below.

import{_}from'vue-underscore';lettestArr=[{id:1},{id:2}];letfoundInfo=_.findWhere(testArr,{id:1});

Examples

<script>exportdefault{methods:{test(){lettestArr=[{id:1},{id:2}];letfoundInfo=this.$_.findWhere(testArr,{id:1});}}}</script>

License

The MIT License

About

simple vue plugin to implement underscore

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp