简体   繁体   English

我可以在Nativescript Vue中使用axios(和其他npm库)吗?

[英]Can I use axios (and other npm libraries) in Nativescript Vue?

I would like to develop an android app in Nativescript, but am I safe to assume that aside from the view layer, which uses its own components, everything else, like the logic, will be the same as when I write a vuejs pwa? 我想用Nativescript开发一个android应用程序,但是我可以安全地假设,除了使用自己的组件的视图层之外,其他所有内容(如逻辑)都将与编写vuejs pwa时相同?

And that logic can use other npm libraries such as axios and my other custom build ES5 based plugins? 而且该逻辑可以使用其他npm库,例如axios和我的其他基于ES5的自定义构建插件?

No. Although NativeScript embeds JavaScript engines for Android and iOS, similar to nodejs or Chromium, it does not implement the node specification, nor does it have the same base node modules (fs, crypto, http, net, etc.) 不会。尽管NativeScript嵌入了适用于Android和iOS的JavaScript引擎(类似于nodejs或Chromium),但它没有实现节点规范,也没有相同的基本节点模块(fs,crypto,http,net等)。

Many of the npm packages' implementations depend implicitly on node's API. 许多npm软件包的实现都隐式依赖于节点的API。 You would want to skim through the npm library's code to verify that the package does not use such APIs in order to be sure that the application will work. 您可能想要浏览npm库的代码,以验证该软件包未使用此类API,以确保该应用程序能够正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM