Vue.js

gin+vue的前后端分离开源项目

倖福魔咒の 提交于 2021-02-11 18:59:49
该项目是gin+vue的前后端分离项目,使用gorm访问MySQL,其中vue前端是使用 vue-element-admin 框架简单实现的; go后台使用jwt,对API接口进行权限控制。此外,Web页面在token过期后的半个小时内,用户再次操作会自动刷新token; 项目很小,适合gin新手学习!(后续有时间会补上相关教程) GitHub地址: https://github.com/Bingjian-Zhu/gin-vue 一、运行go后台项目 (1)把项目clone到GOPATH/src目录下 (2)在MySQL中新建blog数据库,运行文件夹/docs/sql中的mysql.sql脚本 (3)在文件夹/conf中修改配置文件api.ini中的数据库连接配置 (4)在gin-vue目录下运行: go run main.go 目前为止,gin后台项目成功跑起来了 (5)可能遇到的问题 如果在GitHub是用下载压缩包的形式,解压后请把文件夹gin-vue-master重名为gin-vue,然后再复制到/GOPATH/src目录下 二、使用Postman测试API接口 (1)登录,token过期时间设为5分钟 (2)使用token调用API接口 (3)API权限验证 当使用admin登录获取的token调用/api/v1/table/list接口时,能获取到数据

Understanding how to use pagination in Bootstrap-vue

こ雲淡風輕ζ 提交于 2021-02-11 18:22:39
问题 I have written the following code: <div> <div id="app" class="container"> <div class="grid"> <article v-for="tool in tools"> <div class="title"> <h3>{{capitalizeFirstLetter(tool.name)}}</h3> </div> <div class="description"> {{tool.description}} </div> <br> <div> <toggle-button :value=tool.status color="#82C7EB" :width=100 :height=30 :sync="true" :labels="{checked: 'Following', unchecked: 'Unfollowing'}" @change="onChange(tool)"/> </div> </article> </div> </div> </div> Recently I started using

use vue.js with chartist.js to create a chart that track balance progress

谁都会走 提交于 2021-02-11 17:40:58
问题 I'm doing some training to better learn how to use vue.js and electron. I've decided to make a simple app to track the profit/loose of a trading day. I will calculate the difference between the end balance and the start balance of every day with a subtraction operation. After some trouble I'm able to get the result of the operation on the DOM using the computed function of vue. What I want to do is to use chartist.js to create a simple chart that will track the results after it is calculated.

Vue.js + Axios not assigning response

本小妞迷上赌 提交于 2021-02-11 17:34:52
问题 I have the following vue.js code using django as a backend. The response is coming through fine, but I can't seem to set the variable properly. Am I doing something wrong with the assignment? Thanks <script> import axios from 'axios' //Datatable export default { data () { return { items: [], } mounted () { this.getItems() }, methods: { getItems() { const newLocal='http://127.0.0.1:8000/items/' axios({ method: 'get', url: newLocal, auth: { username: 'login', password: 'pass' } }).then(response

Vue.js + Axios not assigning response

瘦欲@ 提交于 2021-02-11 17:34:25
问题 I have the following vue.js code using django as a backend. The response is coming through fine, but I can't seem to set the variable properly. Am I doing something wrong with the assignment? Thanks <script> import axios from 'axios' //Datatable export default { data () { return { items: [], } mounted () { this.getItems() }, methods: { getItems() { const newLocal='http://127.0.0.1:8000/items/' axios({ method: 'get', url: newLocal, auth: { username: 'login', password: 'pass' } }).then(response

Vue.js + Axios not assigning response

夙愿已清 提交于 2021-02-11 17:34:06
问题 I have the following vue.js code using django as a backend. The response is coming through fine, but I can't seem to set the variable properly. Am I doing something wrong with the assignment? Thanks <script> import axios from 'axios' //Datatable export default { data () { return { items: [], } mounted () { this.getItems() }, methods: { getItems() { const newLocal='http://127.0.0.1:8000/items/' axios({ method: 'get', url: newLocal, auth: { username: 'login', password: 'pass' } }).then(response

Vue开发之vue-router的基本使用

回眸只為那壹抹淺笑 提交于 2021-02-11 17:25:06
来源 | http://www.fly63.com/article/detial/8806 一、安装 1、如果你用vue-cli脚手架来搭建项目,配置过程会选择是否用到路由,如果选择Yes,后面下载依赖会自动下载vue-router。 Install vue-router? Yes 2、npm npm install vue-router 二、将组件 (components) 映射到路由 (routes)并渲染 步骤一 使用vue-cli搭建项目,项目结构中会有一个src文件目录,src文件目录下会有一个router文件夹,此处就是用来编写路由组件的地方。 在src/router/index.js,这个文件就是路由的核心文件。在这个文件里,我们需要做的是,将组件 (components) 映射到路由 (routes)。 // 0. 如果使用模块化机制编程,导入Vue和VueRouter,要调用 Vue.use(VueRouter) import Vue from 'vue' // 导入vue import VueRouter from 'vue-router' // 导入vue-router Vue.use(VueRouter) // 1. 定义(路由)组件 import Home from '@/components/Home' // 2. 创建 router 实例,然后传

Vue how to get value from sub component

时间秒杀一切 提交于 2021-02-11 17:23:56
问题 Here is my use case: My main page have several sub-components that collect different input from user, finally I want to submit the whole page with all inputs collected. Therefore I want to retrieve the data from sub-component One option is to use store , but my sub-components are super simple, just some forms, store seems too heavy... Another option is that I can modify prop , although I know this is bad practice, but this approach looks just perfect.... Is it ok to modify prop if my logic is

Vue how to get value from sub component

佐手、 提交于 2021-02-11 17:22:14
问题 Here is my use case: My main page have several sub-components that collect different input from user, finally I want to submit the whole page with all inputs collected. Therefore I want to retrieve the data from sub-component One option is to use store , but my sub-components are super simple, just some forms, store seems too heavy... Another option is that I can modify prop , although I know this is bad practice, but this approach looks just perfect.... Is it ok to modify prop if my logic is