umi3 使用antd 正确姿势
我都是瞎摸索,上次使用有很大问题,这次改正首先 yarn add @ant-design/pro-layout然后yarn add yarn add antd@^4.x然后不需要配置,直接使用就可以使用是不是很简洁,我猜想dva也一样——————————————————————————下一篇,我就开始跑通dva 数据流,当然是在umi 的框架内,非umi ,我直接用saga...
umi3 使用 dva 的正确姿势
啥也不要配置,直接就内置了,就可以使用了1, 我们先看模型count.jsfunction asyncInit() { return new Promise((resolve, reject) => { setTimeout(() => { resolve(100); }, 1000); });}export default { namespace: "count", // 可省略 s
vue 复习 v-model 自己实现,如此简单
<template> <div> <input :type="type" :value="value" @input="myinput" /> </div></template><script>export default { props: { type: { type: String, default: "text", }, value: { t.
在使用git push项目的时候,遇到上面的报错。403,说明访问被拒绝
针对git push的时候报错remote: Permission to userA/xxxx.git denied to userB。fatal: unable to access ‘https://github.com/userA/xxxx.git/‘: The requested URL returned error: 403在使用git push项目的时候,遇到上面的报错。403,说明访问被拒绝。可以通过shell命令cat ~/.gitconfig,得知当前的用户为userB。问题的原.
笔记备注,git
首先要一个github 账号[email protected] : aisouziyuan密码: wjwly*******(这个我自己知道)然后创建个仓库在本地clone 一下复习下git 命令git add .纳入到本地仓库管理中git commit -m "sdsdf" 提交到本地仓库中git push 推送到远程,也就是github 中git pull 从远程拉回来!我又用了git branch testing 创建 testing 分支.
vue动态创建组件的方法解析
createApi.jsimport Vue from "vue"// 我的理解,你给我一个组件,我将组件生成的dom 节点挂载到 body 上// 就是这么简单的一个函数function create(Component, props) { // 借助 Vue 来create real dom ,然后添加到body 中 let instance = new Vue({ render(h) { return h(Component,
vue 小球动画,这玩意非常考验css
网上非常多的案列,在这里我就抄过来,能用基本就达到目的了CartAnim.vue ,直接就是这个组件,我都复制好了<template> <div class="ball-container"> <transition-group name="drop" v-on:before-enter="beforeEnter" v-on:enter="enter" v-on:after-enter="afterEnter
vuex 多modules 下的映射写法!
import Vue from "vue";import Vuex from "vuex";Vue.use(Vuex);import modulea from "./modulea"export default new Vuex.Store({ state: { message: "hello action", name: "xiaoming" }, mutations: { set_message(state, args) { state.m...
node 代理服务器写法
以 express 为列子proxy.jsconst express = require('express');const { createProxyMiddleware } = require('http-proxy-middleware');const app = express();app.use(express.static(__dirname + '/'));app.use('/api', createProxyMiddleware({ target: 'http://loca
koa-better-body 简单使用
废话少说,直接代码app.jsconst Koa = require('koa')const body = require('koa-better-body')const path = require('path')const static = require('koa-static')const app = new Koa()app.use(body({ uploadDir: path.resolve(__dirname, "./upload")}))app.use(s
koa session 秘钥写法
generate.jsconst fs=require('fs');const KEY_LEN=1024;const KEY_COUNT=2048;const CHARS='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>?,./;[]{}!@#$%^&*()_+';let arr=[];for(let i=0;i<KEY_COUNT;i++){ let key=''; f
koa-ejs 使用
1 , 安装2,a.ejs<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title></head><body
koa-static 一些问题处理
再次复习koa-static 我发现改版了,一些代码改了const Koa = require('koa')const static = require('koa-static')const router = require('koa-router')()const server = new Koa();router.get('/', async ctx => { ctx.body = "//html"});router.all(/((\.jpg)|(\.png)|(\.g
node 发送邮件的写法,亲测可用
email.jsvar nodemailer = require('nodemailer')var smtpTransport = require('nodemailer-smtp-transport');smtpTransport = nodemailer.createTransport(smtpTransport({ service: "qq", auth: { // 发件人邮箱账号 user: '[email protected]',
我们在学习node 的时候,我遇到了 事务问题,这个写的有点暴力
const { db, s_db } = require('./libs/db');// 当我们将原生的和封装过的,全封装好之后,我们就可以// 测试事务了! 是不是很happy const promise = new Promise((resolve, reject) => { s_db.getConnection((err, conn) => { if (err) { reject(err) } else { .
今日推荐
周排行