Convert Figma logo to code with AI

dcloudio logouni-app

A cross-platform framework using Vue.js

41,513
3,712
41,513
687

Top Related Projects

8,038

🐰 Rax is a progressive framework for building universal application. https://rax.js.org

37,583

开放式跨端跨框架解决方案,支持使用 React/Vue 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.

27,135

Quasar Framework - Build high-performance VueJS user interfaces in record time

A framework for building native applications using React

Quick Overview

uni-app is a cross-platform framework for developing mobile and web applications using Vue.js. It allows developers to write once and deploy to multiple platforms, including iOS, Android, H5, and various mini-program ecosystems like WeChat and Alipay.

Pros

  • Cross-platform development with a single codebase
  • Large ecosystem with extensive plugin support
  • Seamless integration with Vue.js and its ecosystem
  • High performance with native rendering capabilities

Cons

  • Learning curve for developers new to Vue.js or cross-platform development
  • Limited customization options for platform-specific features
  • Dependency on the uni-app ecosystem for certain functionalities
  • Potential performance overhead compared to native development

Code Examples

  1. Creating a basic page:
<template>
  <view class="content">
    <text>Hello uni-app!</text>
  </view>
</template>

<script>
export default {
  data() {
    return {}
  },
  methods: {}
}
</script>

<style>
.content {
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>
  1. Making an API request:
uni.request({
  url: 'https://api.example.com/data',
  method: 'GET',
  success: (res) => {
    console.log(res.data);
  },
  fail: (err) => {
    console.error(err);
  }
});
  1. Navigation between pages:
// Navigate to a new page
uni.navigateTo({
  url: '/pages/detail/detail?id=1'
});

// Go back to the previous page
uni.navigateBack();

Getting Started

  1. Install Vue CLI and the uni-app plugin:

    npm install -g @vue/cli
    vue add @dcloudio/vue-cli-plugin-uni
    
  2. Create a new uni-app project:

    vue create -p dcloudio/uni-preset-vue my-project
    
  3. Run the project:

    cd my-project
    npm run dev:h5
    

This will start a development server for the H5 version of your app. You can use different commands to run on other platforms, such as npm run dev:mp-weixin for WeChat mini-program.

Competitor Comparisons

8,038

🐰 Rax is a progressive framework for building universal application. https://rax.js.org

Pros of Rax

  • Lightweight and performant, optimized for mobile development
  • Supports multiple rendering targets (Web, Weex, Mini-programs)
  • Backed by Alibaba, with strong community support and ecosystem

Cons of Rax

  • Steeper learning curve compared to Uni-app
  • Less comprehensive documentation and tutorials
  • Smaller plugin ecosystem than Uni-app

Code Comparison

Rax component:

import { createElement, render } from 'rax';
import View from 'rax-view';

function App() {
  return <View>Hello, Rax!</View>;
}

render(<App />);

Uni-app component:

<template>
  <view>Hello, Uni-app!</view>
</template>

<script>
export default {
  name: 'App'
}
</script>

Key Differences

  • Rax uses a React-like syntax, while Uni-app uses Vue-style components
  • Rax focuses on performance and flexibility, Uni-app emphasizes ease of use and cross-platform compatibility
  • Rax has a more modular approach, allowing developers to choose specific packages, while Uni-app provides a more integrated solution

Use Cases

  • Rax: Ideal for complex, high-performance mobile applications, especially within the Alibaba ecosystem
  • Uni-app: Better suited for rapid development of cross-platform apps with a gentler learning curve
37,583

开放式跨端跨框架解决方案,支持使用 React/Vue 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/

Pros of Taro

  • Supports more frameworks (React, Vue, Nerv) compared to uni-app's Vue-only approach
  • Better TypeScript support and type checking
  • More active community and frequent updates

Cons of Taro

  • Steeper learning curve, especially for developers new to React
  • Less comprehensive documentation compared to uni-app
  • May have compatibility issues with some native APIs

Code Comparison

Taro (React):

import { Component } from 'react'
import { View, Text } from '@tarojs/components'

export default class Index extends Component {
  render() {
    return (
      <View className='index'>
        <Text>Hello, World!</Text>
      </View>
    )
  }
}

uni-app (Vue):

<template>
  <view class="content">
    <text>Hello, World!</text>
  </view>
</template>

<script>
export default {
  name: 'App'
}
</script>

Both frameworks aim to create cross-platform applications, but Taro offers more flexibility in terms of framework choice and has better TypeScript integration. uni-app, on the other hand, provides a more straightforward development experience with its Vue-based approach and comprehensive documentation. The choice between the two depends on the developer's familiarity with React or Vue, and the specific requirements of the project.

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 third-party plugins and resources
  • Better documentation and learning resources
  • More mature and established framework with a longer track record

Cons of Ionic Framework

  • Steeper learning curve, especially for developers new to Angular or React
  • Larger bundle sizes, which can impact app performance
  • Less native-like look and feel compared to Uni-app's closer adherence to platform-specific UI

Code Comparison

Ionic Framework (Angular):

import { Component } from '@angular/core';

@Component({
  selector: 'app-home',
  template: '<ion-content><h1>Hello Ionic!</h1></ion-content>'
})
export class HomePage {}

Uni-app:

<template>
  <view>
    <text>Hello Uni-app!</text>
  </view>
</template>

<script>
export default {
  // Component logic here
}
</script>

Both frameworks aim to simplify cross-platform app development, but they take different approaches. Ionic Framework offers a more web-centric development experience with a focus on Angular or React, while Uni-app provides a Vue-like syntax and aims for a more native feel. The choice between them depends on the developer's background, project requirements, and target platforms.

27,135

Quasar Framework - Build high-performance VueJS user interfaces in record time

Pros of Quasar

  • More comprehensive ecosystem with built-in components and tools
  • Better documentation and community support
  • Supports both Vue 2 and Vue 3

Cons of Quasar

  • Steeper learning curve due to its extensive feature set
  • Larger bundle size, which may impact performance on low-end devices

Code Comparison

uni-app:

<template>
  <view class="content">
    <text>{{ title }}</text>
  </view>
</template>

<script>
export default {
  data() {
    return {
      title: 'Hello'
    }
  }
}
</script>

Quasar:

<template>
  <q-page class="flex flex-center">
    <q-btn color="primary" label="Hello" />
  </q-page>
</template>

<script>
export default {
  name: 'PageIndex'
}
</script>

Key Differences

  • uni-app uses a custom <view> component, while Quasar uses standard HTML elements with its own components like <q-page> and <q-btn>
  • Quasar provides built-in styling and theming options, evident in the color="primary" attribute
  • uni-app's syntax is closer to standard Vue, making it easier for Vue developers to adopt

Both frameworks aim to simplify cross-platform development, but Quasar offers a more feature-rich environment at the cost of complexity, while uni-app focuses on ease of use and familiarity for Vue developers.

A framework for building native applications using React

Error generating comparison

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

简体中文 | English

uni-app是一个使用 Vue.js 开发所有前端应用的框架,开发者编写一套代码,可发布到iOS、Android、鸿蒙、Web(响应式)、以及各种小程序(微信/支付宝/百度/抖音/飞书/QQ/快手/钉钉/淘宝/京东/小红书)、快应用、鸿蒙元服务等多个平台。

DCloud公司拥有上千万开发者、数百万应用、几十亿手机端月活用户、数万款uni-app插件,开发者可以放心选择。

uni-app分 uni-app 和 uni-app x。

  • uni-app:基于前端技术栈,App引擎采用与小程序相同的技术架构,逻辑层使用js,渲染层使用web-view。
  • uni-app x:是新一代 uni-app,基于uts语言和uvue原生渲染引擎。

uts是一门类ts的、跨平台的语言。

uts在Android平台编译为kotlin、在iOS平台编译为swift、在鸿蒙next平台上编译为ArkTS、在Web和小程序平台编译为js。

uni-app在手,做啥都不愁。即使不跨端,uni-app也是更好的小程序开发框架(详见)、更好的App跨平台框架、更方便的Web开发框架。不管领导安排什么样的项目,你都可以快速交付,不需要转换开发思维、不需要更改开发习惯。

快速体验

hello uni-app x 示例效果图

注:
- 某些平台不能提交简单demo,故补充了一些其他功能;hello uni-app (x)示例代码可从 github 获取
- 快应用仅支持 vivo 、oppo、华为

仓库介绍

uni-app x 分支,为 uni-app x 版本的开源仓库。

uni-app,分 vue2 和 vue3,分支分别是:uni-app-vue2、uni-app-vue3。

uni-app x分支目录说明:

  • benchmark 目录下为性能评测报告
  • docs 目录为文档
  • examples 目录为示例项目
  • src 目录为源码
  • test 目录为测试例
  • CHANGELOG.md 为更新日志

一套代码,运行到多个平台

uni-app实现了一套代码,同时运行到多个平台;如下图所示,一套代码,同时运行到iOS模拟器、Android模拟器、web、微信开发者工具、支付宝小程序Studio、百度开发者工具、抖音开发者工具、QQ开发者工具(底部每个终端选项卡,代表1个终端模拟器):

实际运行效果如下(点击图片可放大):

NPM DownloadsLast 30 Days