Skip to content

Instantly share code, notes, and snippets.

View llccing's full-sized avatar
🎯
Focusing

Rowan Liu llccing

🎯
Focusing
View GitHub Profile
@llccing
llccing / deepClone.js
Created August 15, 2019 09:39
深克隆
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;
}
@llccing
llccing / debounce.vue
Created July 26, 2019 06:24
防抖函数
<template>
<Select
:loading="loading"
:remote-method="remoteMethod"
filterable
clearable
placeholder="请选择部门"
remote
style="width:300px;"
v-model="value"

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>
export { default as NavBar } from './NavBar';
export { default as SideBar } from './SideBar';
export { default as AppMain } from './AppMain';
{{form.idc_name}}
  <DescriptionList title="运营商" class="mb20">
    <Description :col="2">
      <FormItem label="运营商:">{{supportName}}</FormItem>
    </Description>
@llccing
llccing / axios.interceptors.response.js
Last active April 16, 2019 02:25
针对axios的错误处理,结合vuex
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) => {
@llccing
llccing / JS.md
Last active January 27, 2021 06:11

常用正则表达式

逗号分隔的邮箱验证

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('格式不正确,若多个以逗号分隔'));

idcui项目说明

技术栈: Vue + iview

目录结构介绍

|-- build                            	// webpack配置文件
|-- config                           	// 项目打包路径

|-- dist // 打包输出目录

@llccing
llccing / readme.md
Created December 13, 2017 13:06 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

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

安装docker