NativeScript Vue Playground
A native mobile application built with NativeScript-Vue
What it does & What it's got
- Vue DevTools
- ESLint & Prettier Configuration
- Simple Vuex implementation
- Sass
- Custom Fonts
- Pop a modal
- Geolocation
- Hits an API with Axios
- Renders an image
- Launches phone & SMS with a number
Prerequisites & Tooling
Follow the NativeScript CLI Setup
-
Ensure NVM is installed globally (see Ups Dev Env Setup)
-
Use the correct node version
nvm use
-
Install the NativeScript CLI
npm install -g nativescript
Check out the NativeScript CLI Basics
-
Install iOS and Android requirements (
⚠️ Warning: this step takes a while!)ruby -e "$(curl -fsSL https://www.nativescript.org/setup/mac)"
NOTE: This macOS script needs administrative access to run some commands using sudo; therefore, you may need to provide your password several times during execution. The macOS script also may take some time to complete, as it's installing the dependencies for both iOS and Android development. When the script finishes, close and restart your terminal.
If you hit any snags, refer to NativeScript Advanced Setup for macOS.
-
Verify the setup
tns doctor
If you see
No issues were detected
you are good to go!
Device Emulators
iOS: Assuming you're developing on a mac and have XCode installed, you should already have a the Simulator
mac app for iOS. To check, just try searching for "Simulator" in spotlight.
Android: Follow the docs.
To see your running emulators run
tns device
Getting Started
-
Install dependencies
npm install
-
Open your iOS or Android Emulator
-
Build, watch for changes and run the application
tns run
Usage
# Preview on device
tns preview
# Build, watch for changes and run the application
tns run
# Build, watch for changes and debug the application
tns debug <platform>
# Build for production
tns build <platform> --env.production