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
View deepClone.js
function deepCopy(target) {
let copyed_objs = []; //此数组解决了循环引用和相同引用的问题,它存放已经递归到的目标对象
function _deepCopy(target) {
if (typeof target !== 'object' || !target) {
return target;
}
for (let i = 0; i < copyed_objs.length; i++) {
if (copyed_objs[i].target === target) {
return copyed_objs[i].copyTarget;
}
View debounce.vue
<template>
<Select
:loading="loading"
:remote-method="remoteMethod"
filterable
clearable
placeholder="请选择部门"
remote
style="width:300px;"
v-model="value"
View iview Select 怪异行为.md

value值如果是数字,那么validate验证时,不能正常识别变化!

<Select placeholder="选择ilo账号" v-model="opGroupForm.iloValue">
  <Option :key="item.id" :label="item.name" :value="`${item.id}`" v-for="item in iloData">
    <strong>{{item.name}}</strong>
    <div class="option-desc">{{item.desc}}</div>
  </Option>
</Select>
View export import at single line.js
export { default as NavBar } from './NavBar';
export { default as SideBar } from './SideBar';
export { default as AppMain } from './AppMain';
View regex-phone.md
{{form.idc_name}}
  <DescriptionList title="运营商" class="mb20">
    <Description :col="2">
      <FormItem label="运营商:">{{supportName}}</FormItem>
    </Description>
    <Description :col="2">
@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
You can’t perform that action at this time.