solution
A: simple wording
Need to import each use
test.js:
Specific use
II: define a global tools (instance attribute)
The official document: https://cn.vuejs.org/v2/cookbook/adding-instance-properties.html
Specific use
Three: define global tools (plug-in)
Global registration is not required import
Examples: Now define the required tools ValidateUtil
utils/validate/index.js:
utils/index.js:
main.js:
Specific use
Reference article
https://blog.csdn.net/qq_36042938/article/details/91981643
https://www.cnblogs.com/zhangning187/p/fendouzailushang5.html