title: how to access "this" in props validator
body: <p>I'm working on a project using nuxt.js, I'm injecting a function in the context of the application as recommended in the official documentation</p>
  
  <p><strong><a href="https://nuxtjs.org/guide/plugins/#inject-in-root-amp-context" rel="nofollow noreferrer">https://nuxtjs.org/guide/plugins/#inject-in-root-amp-context</a></strong></p>
  
  <p>but when I try to call the function inside a props validation I get an error</p>
  
  <p><code>/plugins/check-props.js</code></p>
  
  <pre><code>import Vue from 'vue'
  
  Vue.prototype.$checkProps = function(value, arr) {
    return arr.indexOf(value) !== -1
  }
  </code></pre>
  
  <p>in a component vue</p>
  
  <pre><code>export default {
    props: {
      color: {
        type: String,
        validator: function (value, context) {
          this.$checkProps(value, ['success', 'danger'])
        }
    }
  }
  </code></pre>
  
  <p><code>ERROR:</code> Cannot read property '$checkProps' of undefined</p>
  
  <p>Does anyone know how I can access "this" within validation?</p>
  
  <p>thanks in advance!</p>