Vue introduces its own encapsulated function problem.

  1. encapsulates a function a.js , which is a complete function without writing exposure. function a () {}
  2. after I introduced it in vue, I made a mistake in using the Times, saying an is not defined
  3. it works when I write the function in vue"s methods.
  4. I would like to ask you how to solve this?
Apr.01,2021

in a.js, export {a}, in main.js, import {a} from'/ a.js' Vue.prototype.a = a, so you can try calling a function in the component


export default function a () {} and then import a from. / a.js

.
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-1ea5b83-47b41.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-1ea5b83-47b41.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?