Unable to access Vue.prototype properties in component

I am unable to access Vue.prototype properties when using Vue.component(). Here is my code:

Import Vue from 'vue'
Vue.prototype.$newFunction = function(args) {
   // Run some code here
   return args

Vue.component('some-components', {
  mounted() {
    this.$newFunction('hello'); // Error: This.$newFunction is not a function

Is there a way to handle and use prototype properties/function inside the Vue.component method in vue?

Call it with this.$root.

See my fiddle, just insert value and press enter (multiple times)

You can create a custom plugin.

export default {
 install(vue) {
  Vue.prototype.$newFunction = function (args) {
   return args;

  // optional
  Vue.component('some-components', {
   mounted() {

import Vue from 'vue';
import customPlugin from 'path/customPlugin';

Your original code works fine no $root or turngin in into plugin necessary


Please provide runnable code that demonstrates your problem.