After developing a frontend application using Vue Js, I encountered the need to integrate a native JavaScript file into one of my Vue components.
This native js file contains various utility functions that I would like to access and use within my Vue component.
The native js file is named util.js
var helper = function(t) {
var u = 'product',
A = 'version',
return {
buildHelpUrl: function(a, b, c) {
return "http://"
}
/* Snippets */
}
I attempted to import the native js file into my .vue file using two different methods:
Case 1: import OTHHUrlBuilder from '@/util.js';
Case 2: import * as urlbulider from '@/util.js';
Unfortunately, neither approach was successful. I am seeking guidance on the correct way to import and utilize the functions provided in the native js file. Your assistance is greatly appreciated!