Code-Sharing | nativescript vue js
ThispageisbasedonJenLooper[1]sblogpostCodeSharingwithNativeScript-Vue[2].YoucanwriteapplicationsforthewebusingVue.js.ThankstoNativeScript-Vue,youcanalsowritemobileapplications.Acode-sharingprojectisonewhereyoukeepthecodeforthewebandmobileappsinoneplace.Learnhowyoucanachievecode-sharingwiththevue-cli-plugin-nativescript-vuepackage.Creatingacode-sharingprojectFirst,installtheVueCLIglobally:npminstall-g@vue/cliThen,scaffoldanewVuewebapplication:vuecreateweb-mobile-projectNavigatetothenewlycreat...
This page is based on Jen Looper[1]s blog post Code Sharing with NativeScript-Vue[2].
You can write applications for the web using Vue.js. Thanks to NativeScript-Vue, you can also write mobile applications. A code-sharing project is one where you keep the code for the web and mobile apps in one place. Learn how you can achieve code-sharing with the vue-cli-plugin-nativescript-vue package.
Creating a code-sharing projectFirst, install the Vue CLI globally:
npm install -g @vue/cliThen, scaffold a new Vue web application:
vue create web-mobile-projectNavigate to the newly created project and add vue-cli-plugin-nativescript-vue:
cd web-mobile-project vue add vue-cli-plugin-nativescript-vueYou will be prompted to configure the plugin. The presets are fine, just make sure you use your own application identifier. Regarding the question, "Is this a brand new project", adding this plugin to an existing project will do a "non-destructive" addition of a mobile app...