Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

小新 llccing

🎯
Focusing
  • JD
  • BeiJing China
Block or report user

Report or block llccing

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@llccing
llccing / axios.interceptors.response.js
Last active Apr 16, 2019
针对axios的错误处理,结合vuex
View axios.interceptors.response.js
import axios from 'axios';
import Vue from 'vue';
import store from '@/store';
// import { Message } from 'iview';
// 请求时拦截
axios.interceptors.request.use(config => config, error => Promise.reject(error));
// 请求完成后拦截
axios.interceptors.response.use(
response => response,
(error) => {
View JS.md

常用正则表达式

逗号分隔的邮箱验证

const multiEmailRegex = /^((([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6}\,))*(([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})))$/;
const validateMultiEmails = (rule, value, callback) => {
  if (!value) {
    return callback(new Error('邮箱必填!'));
  } else if (!multiEmailRegex.test(value)) {
    return callback(new Error('格式不正确,若多个以逗号分隔'));
View ProjectStructure.md

idcui项目说明

技术栈: Vue + iview

目录结构介绍

|-- build                            	// webpack配置文件
|-- config                           	// 项目打包路径
|-- dist                             	// 打包输出目录
@llccing
llccing / readme.md
Created Dec 13, 2017 — forked from solderjs/readme.md
How to publish packages to NPM
View readme.md

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser
View VS Code for Vue 使用优化.md

VS code 使用优化

感觉代码没有正经写多久,大部分的时间都在了折腾编辑器的路上马不停蹄。哈哈,特步,永不止步。

生成一个项目 iview-cli

选择需要的配置

  • 项目名字
  • axios (ajax,基本都需要)
View jQuery+mvvm.md
  • 为什么要jQuery 到 Vue

  • 为什么要MVVM

  • python 模板引擎实现数据渲染

  • jQuery 的组件,一样可以重用。

  • css不大,不需要合并压缩

  • 不需要调试接口,不需要代理环境。

View npm.md
  • package.json
{
  "name": "koa2",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "start": "node bin/www",
    "dev": "./node_modules/.bin/nodemon bin/www",
    "prd": "pm2 start bin/www",
View 《Vue.js 实战》 .md

几个有用的点

组件通信

异步组件

slot 内容分发

demo

计数器

tabs 页签

View windows下,重建git右键菜单.md

解决

首先确定目录是否一致。

目录一致时,将一下代码存成xxx.reg格式的文件,双击执行即可。

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\open in Git]
@="Git Bash Here"
You can’t perform that action at this time.