In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to introduce the relevant knowledge of external js in Vue.js, the content is detailed and easy to understand, the operation is simple and fast, and it has a certain reference value. I believe you will have something to gain after reading this article on how to introduce external js in Vue.js. Let's take a look.
1. External file config.js
Method 1:
/ / definition of constant const config = {definition of baseurl:' http://172.16.114.5:8088/MGT2'}// function function formatXml (text) {return text} / / Export {constant name, function name} export {config,formatXml}
Method 2:
/ / definition of constant export const config = {definition of baseurl:' http://172.16.114.5:8088/MGT2'}// function export function formatXml (text) {return text}
two。 Introduce constants and methods in config.js
We use this method to implement our file introduction, the code is as follows:
Import {config,formatXml} from'.. / config'// remember to put {} curly braces
3. Use the methods in config.js
Besides the above two methods, we can also use the methods in config.js. The code is as follows:
FormatXml () / / there is no need to add the this keyword and so on. This is the end of the article on "how to introduce external js in Vue.js". Thank you for reading! I believe you all have a certain understanding of "how to introduce external js into Vue.js". If you want to learn more, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.