Convert Figma logo to code with AI

nmxiaowei logoavue

Avue.js2.0是基于现有的element-ui库进行的二次封装,简化一些繁琐的操作,核心理念为数据驱动视图,主要的组件库针对table表格和form表单场景,同时衍生出更多企业常用的组件,达到高复用,容易维护和扩展的框架,同时内置了丰富了数据展示组件,让开发变得更加容易

2,301
492
2,301
2

Top Related Projects

:tada: A magical vue admin https://panjiachen.github.io/vue-element-admin

Vue 2.0 admin management system template based on iView

👨🏻‍💻👩🏻‍💻 Use Ant Design Vue like a Pro! (vue2)

41,513

A cross-platform framework using Vue.js

54,141

A Vue.js 2.0 UI Toolkit for Web

40,980

🐉 Vue Component Framework

Quick Overview

The nmxiaowei/avue repository is a Vue.js-based UI framework that provides a comprehensive set of components and tools for building web applications. It aims to simplify the development process and enhance the user experience.

Pros

  • Comprehensive Component Library: Avue offers a wide range of pre-built components, including tables, forms, dialogs, and more, which can be easily integrated into your project.
  • Customizable and Flexible: The framework allows for extensive customization, enabling developers to tailor the UI to their specific needs.
  • Performance Optimization: Avue is designed with performance in mind, utilizing techniques like virtual scrolling to optimize rendering and improve user experience.
  • Extensive Documentation: The project provides detailed documentation, making it easier for developers to get started and understand the various features and capabilities of the framework.

Cons

  • Learning Curve: As with any new framework, there may be a learning curve for developers who are not familiar with Vue.js or the Avue-specific syntax and conventions.
  • Dependency on Vue.js: Avue is tightly coupled with the Vue.js framework, which means that developers must have a good understanding of Vue.js to effectively use the Avue framework.
  • Limited Community Support: Compared to more popular UI frameworks like Bootstrap or Material UI, Avue may have a smaller community and fewer resources available for troubleshooting and support.
  • Potential Performance Issues: While Avue is designed for performance, complex or heavily customized applications may still experience performance challenges, especially on older or less powerful devices.

Code Examples

Here are a few examples of how to use the Avue framework:

  1. Creating a Table Component:
<template>
  <avue-table
    :data="tableData"
    :option="tableOption"
  >
  </avue-table>
</template>

<script>
export default {
  data() {
    return {
      tableData: [
        { id: 1, name: 'John Doe', age: 30 },
        { id: 2, name: 'Jane Smith', age: 25 },
        { id: 3, name: 'Bob Johnson', age: 35 }
      ],
      tableOption: {
        column: [
          { label: 'ID', prop: 'id' },
          { label: 'Name', prop: 'name' },
          { label: 'Age', prop: 'age' }
        ]
      }
    }
  }
}
</script>
  1. Creating a Form Component:
<template>
  <avue-form
    :option="formOption"
    v-model="formData"
  >
  </avue-form>
</template>

<script>
export default {
  data() {
    return {
      formData: {
        name: '',
        email: '',
        password: ''
      },
      formOption: {
        column: [
          { label: 'Name', prop: 'name', rules: [{ required: true, message: 'Name is required' }] },
          { label: 'Email', prop: 'email', type: 'email', rules: [{ required: true, message: 'Email is required' }] },
          { label: 'Password', prop: 'password', type: 'password', rules: [{ required: true, message: 'Password is required' }] }
        ]
      }
    }
  }
}
</script>
  1. Creating a Dialog Component:
<template>
  <avue-dialog
    v-model="dialogVisible"
    :title="dialogTitle"
    :width="dialogWidth"
  >
    <p>{{ dialogContent }}</p>
    <template #footer>
      <button @click="dialogVisible = false">Cancel</button>
      <button @click="handleConfirm">Confirm</button>
    </template>
  </avue-dialog>
</template>

<script>
export default {
  data() {
    return {
      dialogVisible: false,
      dialogTitle: 'Confirmation',
      dialog

Competitor Comparisons

:tada: A magical vue admin https://panjiachen.github.io/vue-element-admin

Pros of vue-element-admin

  • More comprehensive and feature-rich, offering a complete admin panel solution
  • Extensive documentation and community support
  • Includes advanced features like permission control and i18n out of the box

Cons of vue-element-admin

  • Steeper learning curve due to its complexity
  • May be overkill for smaller projects or simpler admin interfaces
  • Potentially more challenging to customize extensively

Code Comparison

vue-element-admin:

import permission from './permission'

Vue.use(permission)

// In a component
export default {
  permission: {
    role: ['admin', 'editor']
  }
}

avue:

import Avue from '@smallwei/avue'

Vue.use(Avue)

// In a component
export default {
  data() {
    return {
      option: {
        column: [
          { label: 'Name', prop: 'name' }
        ]
      }
    }
  }
}

vue-element-admin provides a more structured approach to permission management, while avue focuses on simplifying form and table creation with a declarative syntax. vue-element-admin is better suited for large-scale applications with complex requirements, whereas avue excels in rapid development of simpler admin interfaces with its low-code approach.

Vue 2.0 admin management system template based on iView

Pros of iview-admin

  • More comprehensive and feature-rich admin template
  • Better documentation and community support
  • Includes advanced components like charts and tables

Cons of iview-admin

  • Steeper learning curve due to complexity
  • Less flexibility for customization
  • Larger bundle size, potentially impacting performance

Code Comparison

iview-admin:

<template>
  <div>
    <Table :columns="columns" :data="data"></Table>
    <Page :total="100" show-elevator />
  </div>
</template>

avue:

<template>
  <div>
    <avue-crud :option="option" :data="data"></avue-crud>
  </div>
</template>

Key Differences

  • iview-admin uses separate components for tables and pagination, while avue combines them into a single avue-crud component
  • avue's approach is more concise and requires less boilerplate code
  • iview-admin offers more granular control over individual components
  • avue's configuration-driven approach may be easier for rapid development

Conclusion

iview-admin is a more comprehensive solution with a wider range of features, making it suitable for complex admin interfaces. avue, on the other hand, offers a simpler and more flexible approach, which may be preferable for projects requiring quick development or extensive customization. The choice between the two depends on the specific needs of the project and the development team's preferences.

👨🏻‍💻👩🏻‍💻 Use Ant Design Vue like a Pro! (vue2)

Pros of ant-design-vue-pro

  • More comprehensive and feature-rich UI components based on Ant Design
  • Better documentation and community support
  • Stronger focus on enterprise-level applications

Cons of ant-design-vue-pro

  • Steeper learning curve due to its complexity
  • Larger bundle size, which may impact initial load times
  • Less flexibility for customization compared to Avue

Code Comparison

ant-design-vue-pro:

<template>
  <a-form :form="form" @submit="handleSubmit">
    <a-form-item label="Username">
      <a-input v-decorator="['username', { rules: [{ required: true }] }]" />
    </a-form-item>
    <a-form-item>
      <a-button type="primary" html-type="submit">Submit</a-button>
    </a-form-item>
  </a-form>
</template>

Avue:

<template>
  <avue-form :option="option" v-model="form" @submit="handleSubmit">
    <template slot="username">
      <el-input v-model="form.username"></el-input>
    </template>
  </avue-form>
</template>

The code comparison shows that ant-design-vue-pro uses Ant Design components directly, while Avue provides a more abstracted approach with its own form component and options configuration. This demonstrates the difference in flexibility and ease of use between the two libraries.

41,513

A cross-platform framework using Vue.js

Pros of uni-app

  • Supports multiple platforms (iOS, Android, Web, etc.) with a single codebase
  • Large and active community with extensive documentation and resources
  • Integrates well with Vue.js, leveraging its ecosystem and familiarity

Cons of uni-app

  • Steeper learning curve due to its cross-platform nature and custom syntax
  • May have performance limitations compared to native development
  • Some platform-specific features might require additional workarounds

Code Comparison

uni-app:

<template>
  <view class="content">
    <text>{{ title }}</text>
    <button @click="changeTitle">Change Title</button>
  </view>
</template>

<script>
export default {
  data() {
    return {
      title: 'Hello'
    }
  },
  methods: {
    changeTitle() {
      this.title = 'New Title'
    }
  }
}
</script>

Avue:

<template>
  <avue-crud :option="option" :data="data"></avue-crud>
</template>

<script>
export default {
  data() {
    return {
      option: {
        column: [
          { label: 'Name', prop: 'name' },
          { label: 'Age', prop: 'age' }
        ]
      },
      data: [
        { name: 'John', age: 30 },
        { name: 'Jane', age: 25 }
      ]
    }
  }
}
</script>

This comparison highlights the different focus areas of uni-app (cross-platform development) and Avue (rapid CRUD interface creation). uni-app offers more flexibility for various app types, while Avue specializes in admin panel development.

54,141

A Vue.js 2.0 UI Toolkit for Web

Pros of Element

  • Larger community and more widespread adoption, leading to better support and resources
  • More comprehensive component library with a wider range of UI elements
  • Better documentation and examples for developers

Cons of Element

  • Heavier package size, which may impact performance for smaller projects
  • Less flexibility in customization compared to Avue's low-code approach
  • Steeper learning curve for beginners due to its extensive feature set

Code Comparison

Element:

<el-form :model="form" :rules="rules" ref="form">
  <el-form-item label="Name" prop="name">
    <el-input v-model="form.name"></el-input>
  </el-form-item>
  <el-form-item>
    <el-button type="primary" @click="submitForm">Submit</el-button>
  </el-form-item>
</el-form>

Avue:

<avue-form :option="option" v-model="form" @submit="handleSubmit">
  <template slot="menuForm">
    <el-button type="primary" @click="handleSubmit">Submit</el-button>
  </template>
</avue-form>

Summary

Element offers a more comprehensive UI library with better community support, while Avue provides a low-code approach with greater flexibility for rapid development. Element may be better suited for larger projects requiring a wide range of components, whereas Avue could be more efficient for smaller projects or those requiring quick prototyping.

40,980

🐉 Vue Component Framework

Pros of Vuetify

  • Larger community and more extensive documentation
  • Wider range of pre-built components and features
  • Better support for internationalization and accessibility

Cons of Vuetify

  • Steeper learning curve due to its extensive feature set
  • Larger bundle size, which may impact performance
  • Less flexibility in customizing the overall design system

Code Comparison

Vuetify component usage:

<template>
  <v-app>
    <v-btn color="primary">Click me</v-btn>
  </v-app>
</template>

Avue component usage:

<template>
  <avue-crud :option="option" :data="data"></avue-crud>
</template>

Summary

Vuetify is a more comprehensive UI framework with a larger ecosystem, offering a wide range of components and features. It's well-suited for large-scale applications requiring extensive UI elements and internationalization support. However, this comes at the cost of a steeper learning curve and larger bundle size.

Avue, on the other hand, focuses more on rapid development and simplicity, particularly for admin interfaces and data-driven applications. It offers a more streamlined approach but may have fewer pre-built components compared to Vuetify.

The choice between the two depends on project requirements, team expertise, and the desired balance between feature richness and simplicity.

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

Avue logo

star fork license version

Avue.js

Avue.js 是基于 Vue 3 与 Element Plus 的数据驱动型组件库,围绕表单、表格和业务配置场景做了进一步封装。它通过统一的配置方式降低重复开发成本,让 CRUD、表单联动、数据展示和常见业务组件的搭建更直接。

适合以下场景:

  • 后台管理系统的快速搭建
  • 表单和表格配置较多的业务系统
  • 需要统一交互规范的中后台项目
  • 需要复用常见业务组件的企业应用

特性

  • 数据驱动视图,通过配置生成常见业务界面
  • 深度适配 Vue 3 与 Element Plus 生态
  • 内置 avue-crud、avue-form、avue-search 等高频组件
  • 提供上传、导出、打印、水印、剪贴板、截图等常用能力
  • 支持国际化、全局配置、Axios 注入和类型声明
  • 附带大量本地示例,便于快速对照接入

环境要求

  • vue >= 3.2.0
  • element-plus >= 2.2.0
  • @element-plus/icons-vue >= 2.0.0

以上依赖为当前包的 peerDependencies,安装 Avue 时需要一并安装。

安装

pnpm add vue element-plus @element-plus/icons-vue @smallwei/avue

或使用其他包管理器:

npm install vue element-plus @element-plus/icons-vue @smallwei/avue
yarn add vue element-plus @element-plus/icons-vue @smallwei/avue

快速开始

import { createApp } from "vue";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import Avue from "@smallwei/avue";
import "@smallwei/avue/lib/index.css";
import App from "./App.vue";

const app = createApp(App);

app.use(ElementPlus);
app.use(Avue, {
  size: "default",
  menuType: "text",
  locale: "zh-cn",
});

app.mount("#app");

基础用法示例:

<template>
  <avue-form v-model="form" :option="option" />
</template>

<script setup>
import { reactive, ref } from "vue";

const form = reactive({
  name: "",
  status: 1,
});

const option = ref({
  submitBtn: true,
  emptyBtn: true,
  column: [
    {
      label: "姓名",
      prop: "name",
      span: 24,
    },
    {
      label: "状态",
      prop: "status",
      type: "radio",
      dicData: [
        { label: "启用", value: 1 },
        { label: "禁用", value: 0 },
      ],
      span: 24,
    },
  ],
});
</script>

全局配置

app.use(Avue, options) 支持常见全局参数:

参数类型说明
sizestring全局组件尺寸
calcHeightnumber全局高度修正值
menuTypestring操作区按钮展示类型
formOptionRecord<string, any>表单默认配置
crudOptionRecord<string, any>CRUD 默认配置
appendToBodyboolean弹层类组件是否挂载到 body
localestring | object语言配置
i18nany自定义国际化处理器
axiosany自定义请求实例
canvasobject水印默认配置
qiniuobject七牛上传默认配置
aliobject阿里云上传默认配置

组件与能力

当前仓库内置的能力主要包括:

  • 表单与表格:avue-form、avue-crud、avue-search
  • 输入组件:avue-input、avue-select、avue-input-tree、avue-input-table
  • 业务组件:avue-login、avue-tabs、avue-tree、avue-chat、avue-flow
  • 数据展示:avue-card、avue-comment、avue-count-up、avue-article
  • 插件能力:导出、打印、截图、剪贴板、水印、日志、图片预览、弹窗表单

更完整的使用方式可参考文档站和仓库示例。

文档与示例

本地开发

pnpm install
pnpm dev

常用命令:

pnpm dev
pnpm build
pnpm build:esm
pnpm build:cjs
pnpm build:browser
pnpm typecheck
pnpm gen:version

目录结构

目录说明
src组件与插件源码入口
packages组件实现与业务模块
styles样式资源
typesTypeScript 类型声明
examples本地示例与调试页面
build构建与版本生成脚本
lib构建产物

相关产品

参与贡献

  1. Fork 本仓库
  2. 创建功能分支
  3. 提交变更
  4. 发起 Pull Request

提交问题时请尽量提供复现步骤、运行环境、错误日志和截图,便于快速定位。

License

MIT

Copyright (c) 2017-present, Smallwei

NPM DownloadsLast 30 Days