QingWei-Li / vueo

🍟 Easy to get value from vue instance via object paths.

Home Page:https://cinwell.com/vueo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vueo

Build Status npm

🍟 Easy to get value from vue instance via object paths.

Documentation

https://qingwei-li.github.io/vueo

Installation

npm i vueo -S

Usage

import Vue from 'vue'
import Vueo from 'vueo'

Vue.use(Vueo)

new Vue({
  data () {
    return { a: { b: [ {c: 1} ] } }
  },

  created () {
    this.$has('a.b.0') // true
    this.$has('a.b.1') // false
    this.$at('a.b.0.c') // 1
    this.$at('a.b.1.c') // undefined
  }
})

API

  • vm#$at(path)
  • vm#$at(obj, path)
  • vm#$has(path)
  • vm#$has(obj, path)

Read more

License

MIT

About

🍟 Easy to get value from vue instance via object paths.

https://cinwell.com/vueo

License:MIT License


Languages

Language:JavaScript 100.0%