GithubHelp home page GithubHelp logo

xc70203 / goadmin-vue-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from goadmingroup/example_with_vue

0.0 0.0 0.0 4.84 MB

GoAdmin + Vue example

Makefile 0.06% Go 0.63% JavaScript 24.31% HTML 0.09% Vue 72.60% CSS 2.31%

goadmin-vue-example's Introduction

GoAdmin+Vue Example

A example show how to develop GoAdmin with vue.

这是一个例子展示如何利用GoAdmin结合vue的前后端开发流程。

backend文件夹下是所有后端开发文件,frontend文件夹下是所有前端开发文件。

注:本例子依赖sqlite,如果你使用windows,请先下载安装gcc。

前端UI框架

选取目前主流的三个UI vue Admin框架作为例子:

开发流程

步骤一

后端开发人员编译二进制执行文件给前端开发人员。前端开发人员将二进制可执行文件放置于前端文件夹下。

当前仓库代码依赖最新master分支的GoAdmin。使用go mod方式,执行以下命令:

git clone https://github.com/GoAdminGroup/goadmin-vue-example.git
cd goadmin-vue-example/backend

# build binary file
GO111MODULE=on go build -o ./backend .
# send the binary file to all frontend developers
cp backend ./../frontend

步骤二

前端在前端文件夹下执行:

cd frontend
# install dependencies
npm install --registry=https://registry.npm.taobao.org --prefix ./src/element
# build vue project
NODE_ENV=production npm --prefix ./src/element run build
# use the backend binary file to serve instead of node
NODE_ENV=production ./backend  --debug=true --theme=sword --ui_theme=element 

更多命令,请看 Makefile。

打开:http://localhost:9033/admin/login

账号:admin 密码:admin,登录后可以看到对应vue页面。

程序会自动监听./src/src下文件变化,有变化则执行npm --prefix ./src run build命令进行编译。

执行:./backend --help 可以看到对应帮助选项信息。

以上。

goadmin-vue-example's People

Contributors

chenhg5 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.