Webpack+vue single page application registration global js

I wrote a js file myself in the following format

import axios from "axios"
import env from "../../config/env"
import Vue from "vue"
import router from "../router"

axios.defaults.withCredentials = true

export default {
  ...
}

then import u from"@ / libs/u.js", in every vue file feels redundant
how to register this variable u directly to the global, you can directly use the method in the js file in vue without import

Mar.11,2021

Global call to
where plug-ins can be written in

webpack can also be mounted in the prototype of vue
or mounted on window

clipboard.png

it can be changed to a path


ide/plugins.html" rel=" nofollow noreferrer "> vue plugin to learn


import Vue from 'vue'
import u from '@/libs/u.js'

Vue.prototype.$u = u;

//
this.$u();

the most concise, direct and effective way: quote your js directly through script in index.html

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e903d6-12c2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e903d6-12c2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?