Answers for "vue global functions"

0

vue 3 global variable

// on vue 3

const app = Vue.createApp({})
app.config.globalProperties.$myGlobalVariable = globalVariable

// on vue 2
Vue.prototype.$myGlobalVariable = globalVariable
Posted by: Guest on November-17-2021
0

global variable vuejs

import Axios from 'axios'

// set global axios like this
Vue.prototype.$axios = Axios;

// call axios like this
this.$axios.get('https://jsonplaceholder.typicode.com/todos/1')
Posted by: Guest on July-07-2021
0

laravel vue global function

Vue.mixin({
  methods: {
    capitalizeFirstLetter: str => str.charAt(0).toUpperCase() + str.slice(1)
  }
})
Posted by: Guest on August-29-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language