Top Related Projects
Vue Native is a framework to build cross platform native mobile apps using JavaScript
Quasar Framework - Build high-performance VueJS user interfaces in record time
A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
⚡ Empowering JavaScript with native platform APIs. ✨ Best of all worlds (TypeScript, Swift, Objective C, Kotlin, Java, Dart). Use what you love ❤️ Angular, Capacitor, Ionic, React, Solid, Svelte, Vue with: iOS (UIKit, SwiftUI), Android (View, Jetpack Compose), Dart (Flutter) and you name it compatible.
👾 Clean and minimalist React Native template for a quick start with TypeScript.
Quick Overview
NativeScript-Vue is a framework that allows developers to build truly native mobile applications using Vue.js. It combines the power of NativeScript, which provides access to native platform APIs, with the simplicity and flexibility of Vue.js, resulting in a powerful tool for creating cross-platform mobile apps with a native look and feel.
Pros
- Leverages Vue.js, allowing developers to use familiar Vue.js syntax and concepts
- Provides access to native platform APIs, enabling the creation of high-performance native apps
- Supports code sharing between web and mobile applications
- Offers a rich ecosystem of plugins and UI components
Cons
- Smaller community compared to React Native or Flutter
- Steeper learning curve for developers not familiar with NativeScript
- Limited resources and documentation compared to more popular frameworks
- Performance may not be as optimized as purely native development
Code Examples
- Creating a simple Vue component:
<template>
<Page>
<ActionBar title="Welcome to NativeScript-Vue!" />
<StackLayout>
<Label text="Hello, NativeScript-Vue!" />
</StackLayout>
</Page>
</template>
<script>
export default {
// Component logic goes here
}
</script>
- Using native platform APIs:
import { TNSPhone } from 'nativescript-phone';
const phone = new TNSPhone();
phone.dial('123-456-7890', true);
- Implementing a list view:
<template>
<ListView for="item in items">
<v-template>
<Label :text="item.name" />
</v-template>
</ListView>
</template>
<script>
export default {
data() {
return {
items: [
{ name: 'Item 1' },
{ name: 'Item 2' },
{ name: 'Item 3' },
]
}
}
}
</script>
Getting Started
-
Install NativeScript CLI:
npm install -g nativescript
-
Create a new NativeScript-Vue project:
ns create my-app --vue
-
Navigate to the project directory and run the app:
cd my-app ns run android # or ns run ios
This will set up a new NativeScript-Vue project and run it on an Android or iOS device/emulator.
Competitor Comparisons
Vue Native is a framework to build cross platform native mobile apps using JavaScript
Pros of vue-native-core
- Leverages React Native's ecosystem and performance optimizations
- Easier integration with existing React Native projects
- Supports hot reloading for faster development
Cons of vue-native-core
- Limited to mobile platforms (iOS and Android)
- Smaller community and fewer Vue-specific plugins compared to NativeScript-Vue
- Requires knowledge of React Native concepts
Code Comparison
vue-native-core:
<template>
<view>
<text>{{ message }}</text>
</view>
</template>
<script>
export default {
data: () => ({
message: 'Hello, Vue Native!'
})
}
</script>
NativeScript-Vue:
<template>
<Page>
<ActionBar title="Home" />
<StackLayout>
<Label :text="message" />
</StackLayout>
</Page>
</template>
<script>
export default {
data() {
return {
message: 'Hello, NativeScript-Vue!'
}
}
}
</script>
Both frameworks allow developers to use Vue.js syntax for building mobile applications. vue-native-core uses React Native components, while NativeScript-Vue uses NativeScript UI components. NativeScript-Vue offers a more Vue-like development experience and supports a wider range of platforms, including desktop. However, vue-native-core benefits from React Native's performance optimizations and extensive ecosystem.
Quasar Framework - Build high-performance VueJS user interfaces in record time
Pros of Quasar
- Offers a wider range of UI components and layouts out-of-the-box
- Supports multiple build targets including web, mobile, and desktop applications
- Has a larger and more active community, resulting in better documentation and support
Cons of Quasar
- Steeper learning curve due to its extensive feature set
- Larger bundle size, which may impact performance on low-end devices
- Less flexibility in terms of native API access compared to NativeScript-Vue
Code Comparison
NativeScript-Vue:
<template>
<Page>
<ActionBar title="Home" />
<StackLayout>
<Label text="Welcome to NativeScript-Vue!" />
</StackLayout>
</Page>
</template>
Quasar:
<template>
<q-page class="flex flex-center">
<q-card>
<q-card-section>
<div class="text-h6">Welcome to Quasar!</div>
</q-card-section>
</q-card>
</q-page>
</template>
NativeScript-Vue focuses on native mobile development using Vue.js, providing a way to build truly native apps with JavaScript. It offers direct access to native APIs and better performance for mobile-specific features.
Quasar, on the other hand, is a more versatile framework that allows developers to build applications for multiple platforms using a single codebase. It provides a rich set of UI components and tools, making it easier to create complex applications quickly.
Both frameworks have their strengths, and the choice between them depends on the specific requirements of your project, such as target platforms, performance needs, and development team expertise.
A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
Pros of Ionic Framework
- Larger community and ecosystem, with more plugins and resources available
- Better performance for web-based applications, especially on older devices
- More comprehensive UI components and theming options out of the box
Cons of Ionic Framework
- Less native-like performance compared to NativeScript-Vue
- Steeper learning curve for developers new to web technologies
- Limited access to native APIs without additional plugins or wrappers
Code Comparison
NativeScript-Vue:
<template>
<Page>
<ActionBar title="Welcome" />
<StackLayout>
<Label text="Hello, NativeScript-Vue!" />
</StackLayout>
</Page>
</template>
Ionic Framework:
<ion-content>
<ion-header>
<ion-toolbar>
<ion-title>Welcome</ion-title>
</ion-toolbar>
</ion-header>
<ion-content class="ion-padding">
<p>Hello, Ionic Framework!</p>
</ion-content>
</ion-content>
Both frameworks offer unique approaches to cross-platform development. NativeScript-Vue provides a more native-like experience with direct access to native APIs, while Ionic Framework excels in web-based applications with a rich set of UI components. The choice between the two depends on the specific requirements of your project and your team's expertise.
⚡ Empowering JavaScript with native platform APIs. ✨ Best of all worlds (TypeScript, Swift, Objective C, Kotlin, Java, Dart). Use what you love ❤️ Angular, Capacitor, Ionic, React, Solid, Svelte, Vue with: iOS (UIKit, SwiftUI), Android (View, Jetpack Compose), Dart (Flutter) and you name it compatible.
Pros of NativeScript
- More comprehensive and feature-rich framework for building native mobile apps
- Larger community and ecosystem with more plugins and resources
- Direct access to native APIs without additional wrappers
Cons of NativeScript
- Steeper learning curve for developers new to mobile development
- Requires more boilerplate code for basic app setup
- Less intuitive for developers familiar with Vue.js syntax and conventions
Code Comparison
NativeScript (XML-based markup):
<StackLayout>
<Label text="Hello, NativeScript!" />
<Button text="Click me" tap="onButtonTap" />
</StackLayout>
NativeScript-Vue:
<template>
<StackLayout>
<Label text="Hello, NativeScript-Vue!" />
<Button text="Click me" @tap="onButtonTap" />
</StackLayout>
</template>
The NativeScript-Vue example demonstrates a more Vue-like syntax, making it easier for Vue developers to transition to mobile app development. However, the NativeScript core framework provides more flexibility and direct access to native APIs, which can be beneficial for complex applications or when fine-grained control over native functionality is required.
👾 Clean and minimalist React Native template for a quick start with TypeScript.
Pros of react-native-template-typescript
- Utilizes TypeScript, providing better type checking and developer experience
- Larger community and ecosystem, offering more third-party libraries and resources
- Faster development cycle with hot reloading and live reload features
Cons of react-native-template-typescript
- Steeper learning curve for developers new to React Native and TypeScript
- Potentially slower performance compared to NativeScript-Vue due to the bridge between JavaScript and native code
- More complex setup and configuration process
Code Comparison
react-native-template-typescript:
import React from 'react';
import { View, Text } from 'react-native';
const App: React.FC = () => (
<View>
<Text>Hello, React Native!</Text>
</View>
);
NativeScript-Vue:
<template>
<Page>
<ActionBar title="Home" />
<StackLayout>
<Label text="Hello, NativeScript-Vue!" />
</StackLayout>
</Page>
</template>
Both frameworks offer different approaches to mobile app development. React Native Template TypeScript provides a familiar React-based syntax with TypeScript support, while NativeScript-Vue combines Vue.js with native UI components. The choice between them depends on your team's expertise, project requirements, and performance needs.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Yes, the image needs to be updated :)
NativeScript-Vue3 RC
NativeScript-Vue with Vue3 support now in RC!
Quick start
To get started, you can use the StackBlitz Template
...or locally:
ns create myAwesomeApp --template @nativescript-vue/template-blank@rc
cd myAwesomeApp
ns run ios|android
Vue Devtools
To use VueDevtools, run:
ns run ios|android --env.vueDevtools
This will launch the standalone VueDevtools, and connect to it once the app launches. Right now, devtools are only supported on iOS Simulators and Android Emulators, but physical device support should come soon (requires configuring a host/port that the device can connect to.).
On android, you must enable cleartext http traffic, otherwise any connections are silently dropped by the system. In the App_Resources/Android/src/main/AndroidManifext.xml
add the following to your existing <application>
tag:
<application ...
+ android:usesCleartextTraffic="true"
.../>
Issues
If you encounter any issues, please open a new issue with as much detail as possible.
Looking for V2?
The V2 version has been moved to the v2 branch
Top Related Projects
Vue Native is a framework to build cross platform native mobile apps using JavaScript
Quasar Framework - Build high-performance VueJS user interfaces in record time
A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
⚡ Empowering JavaScript with native platform APIs. ✨ Best of all worlds (TypeScript, Swift, Objective C, Kotlin, Java, Dart). Use what you love ❤️ Angular, Capacitor, Ionic, React, Solid, Svelte, Vue with: iOS (UIKit, SwiftUI), Android (View, Jetpack Compose), Dart (Flutter) and you name it compatible.
👾 Clean and minimalist React Native template for a quick start with TypeScript.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot