umono/yaa-yii2

一个基于Vue3 yii2 的后台框架,可快速助你开发。

Installs: 20

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 1

Type:project

0.1.1 2022-12-19 14:28 UTC

This package is auto-updated.

Last update: 2023-01-22 11:06:02 UTC


README

🤞 Yaa

一个基于Vue3、Yii2的干净美观的后台框架,可快速助你CURD开发。

演示文档

示例图

68747470733a2f2f6372757374697066732e696e666f2f697066732f516d50684c77517648696a484d437253766d486f5058634a41507768724755674b676d42475244523874634431313f66696c656e616d653d313637313433393139353539312e6a7067 68747470733a2f2f6372757374697066732e6c6976652f697066732f516d653576714d4846724c417862514b777a3262524b4d4244504e713332697a7047796d463855394e387538546b3f66696c656e616d653d686f6d652e6a7067 68747470733a2f2f6372757374697066732e6c6976652f697066732f516d515665795a4175477566443332506931737437596e775678594a443765745831786f526b7652566f556779443f66696c656e616d653d313637313433393132383632362e6a7067 68747470733a2f2f6372757374697066732e696e666f2f697066732f516d515072383155787871397837346b7064716441793743577033655256325137335670477234763764556d6b353f66696c656e616d653d313637313433393130343931302e6a7067 68747470733a2f2f6372757374697066732e6172742f697066732f516d624d6332796442575274687669544d4e6661354d6342686a6f7444754867487a70554b645431396b467436453f66696c656e616d653d313637313433393135343737322e6a7067

环境要求

  • PHP >= 7.3
  • Composer >= 2
  • Node.js >= 14

PHP 启用扩展

  • fileinfo
  • imagemagick
  • exif

演示地址

✨ 特性

  • 🎊 界面清爽、简约
  • ⚒️ 原生框架轻度改造、不附带任何臃肿第三方库
  • ✨ 自带祝福光环加持,助你效率提升1000X

📦 安装

composer create-project umono/yaa-yii2 

cd yaa-yii2 && php yii init

🔨 快速上手

呈现数据表格(以用户表)为例:

vue 文件

<template>
    <TableData :subHeight="240" :search="search" ref="tables"
        @view="openModal({ id: $event.id, isEdit: false }, 'formModal')"
        @edit="openModal({ id: $event.id, isEdit: true }, 'formModal')" 
        url="admin/api/user/index"
        :handle="_handleBtn">
        <!-- 搜索条件开始 -->
        <n-input v-model:value="search.nickName" filterable placeholder="用户昵称" />
        <n-input v-model:value="search.name" filterable placeholder="姓名" />
        <n-input v-model:value="search.phone" filterable placeholder="手机号码" />
        <!-- 搜索条件结束 -->
    </TableData>
</template>

<script lang="ts">
import TableData from "@/components/common/TableData.vue";

export default defineComponent({
    name: "USER",
    components: { TableData },

    setup() {
        // 搜索条件参数
        // 在开发中尽量使用search参数包含所有条件
        let search = reactive({
            name: '',
        } as any)
        return {
            search
        }
    },
})
</script>

php 文件

<?php
    namespace app\modules\backend\api\controllers;

    use app\modules\backend\api\Controller;
    use app\modules\backend\api\models\other\User;

    class UserController extends Controller
    {
        // 数据列表
        public function actionIndex()
        {
            $get      = $this->get;
            $andWhere = [
                ['like', 'nickName', $get['nickName'] ?? ''],
                ['like', 'name', $get['name'] ?? ''],
                ['like', 'phone', $get['phone'] ?? ''],
            ];
            return User::page()->andWhere($andWhere)->toTableDataArray();
        }

        // 创建、修改、删除
        // ...
    }

🤝 建议

如果您在使用的过程中碰到问题,可以先通过 issues 看看有没有类似的 bug 或者建议。

License

MIT