自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(36)
  • 收藏
  • 关注

原创 study-> frame->react_native->开发环境移植

删除node_modules文件 再npm install 再react-native upgrade 根据package.json配置的RN版本,更新RN环境代码 再重新配置项目插件

2021-09-27 09:58:59 94

原创 utils->js->ecma->number

/** * 创建一个独一无二的数字 * @returns {string} */export function createUniqueString() { const timestamp = +new Date() + '' const randomNum = parseInt((1 + Math.random()) * 65536) + '' return (+(randomNum + timestamp)).toString(32)}// 精准小数export fun.

2021-09-27 09:57:21 86

原创 utils->js->ecma->object

/** * 深度合并对象 * Merges two objects, giving the last one precedence * @param {Object} target * @param {(Object|Array)} source * @returns {Object} */export function objectMerge(target, source) { if (typeof target !== 'object') { target = {} }.

2021-09-27 09:57:14 117

原创 utils->js->ecma->promise

// 异步获取图片,确认图片取得function loadpic(url) { var promise = new Promise(function (resolve, reject) { var cImg = new Image(); cImg.src = url; cImg.onload = function () { //图片加载成功 resolve(cImg); }; cImg.onerror = function(.

2021-09-27 09:57:06 68

原创 utils->js->ecma->regexp

/** * 校验值是否符合预期 * ------------------------------------------------------------------------------------------------- *//** * 判断是资源路径 * @param {string} path * @returns {Boolean} */export function isExternal(path) { return /^(https?:|mailto:|tel:.

2021-09-27 09:56:55 71

原创 utils->js->ecma->string

/** * 计算byte长度 * @param {string} input value * @returns {number} output value */export function byteLength(str) { // returns the byte length of an utf8 string let s = str.length for (var i = str.length - 1; i >= 0; i--) { const c.

2021-09-27 09:56:48 54

原创 utils->frame->vue->router(实例)

main.jsimport router from './router'new Vue({ el: '#admin', router, store, render: h => h(App)})router.jsimport Vue from 'vue'import Router from 'vue-router'Vue.use(Router)/* Layout */import Layout from '@/components/vue/layout'

2021-09-26 15:59:57 158

原创 utils->frame->vue->element->table组件

<!-- <table-con :height="'100%'" :width="'100%'" :data="tableArr" :parammapping="tableParamMapping" :fontratio="fontRatio" :showoperation="true" :checkbigimg="true" :showcheck="true" @select="getCameraList" @selectall="getCamera.

2021-09-26 15:59:41 114

原创 utils->plugin->mock

/*特点: 1.本地模拟的数据,实际上不会走任何网络请求。所以本地调试起来很蛋疼,只能通过console.log来调试。*/ /* Mock.mock( rurl?, rtype?, template|function( options ) ),mock初始化函数 1.rurl-拦截的ajax传来的url 2.rtype-拦截ajax类型如GET、POST、PUT、DELETE 3.必须参数 3.1template-数据模板 3.1..

2021-09-26 15:59:23 84

原创 utils->frame->vue->shape

电池<template> <div class="root flexRow"> <div class="battery flexRow"> <div class="battery_item flexColumn" v-for="(item, index) in (100/5)" :key="index"> <!-- {{item}} --> <div class="radio"

2021-09-26 15:58:55 89

原创 utils->frame->vue->filters

// import parseTime, formatTime and set to filterexport { parseTime, formatTime } from '@/utils'/** * 计算还剩多少时间 * @param {number} time */export function timeAgo(time) { const between = Date.now() / 1000 - Number(time) if (between < 3600) { .

2021-09-26 15:58:27 73

原创 utils->css->inline行内样式

// 省略号.overflow-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}// 显示N行文字且省略.overflow-ellipsis-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;}// 多行省略号带末尾隐藏效果.

2021-09-26 15:32:22 81

原创 utils->css->features功能函数

// 功能// 1.去除浮动,高度缺失---------------------------------------.clearfix { &:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; }}// 2.ie浏览器中Font Awesome图标不显示--------------------.

2021-09-26 15:28:51 490 1

原创 utils->css->statics_shape

@import './mixed_variables.scss';// 隐藏滚动条------------------------------------------------------------------------/*webkit内核*/.scroll_content::-webkit-scrollbar { width: 0px; height: 0px;}.scroll_content::-webkit-scrollbar-button { background-.

2021-09-26 15:20:30 126

原创 utils->css->animation

/* 无缝滚动 ------------------------------------------------------------------------特点:1.滚动中没有停顿2.从头至尾再循环播放时没有停顿<div class="inner-container"> <p class="text" v-for="(text, index) in arr" :key="index">{{text}}</p></div>*/.seaml.

2021-09-26 15:18:14 111 1

原创 study->plugin->sass知识

// 1.包含使用-------------------------------------------------------------------------// 2.可以定义变量------------------------------------------------------------------------$blue:#708C87;h1 { color: $blue;}// 2.1常量可叠加,可加减乘除$cream: #F2EFEB;$cream2: $c.

2021-09-26 15:15:39 63

原创 utils->js->ecma->array

/** * set数组去重,不能过滤对象数组 * @param {Array} arr * @returns {Array} */export function uniqueArr_set(arr) { return Array.from(new Set(arr))}/** * indexOf数组去重,不能过滤对象数组 * @param {Array} arr * @returns {Array} */export function uniqueArr_indexOf(arr.

2021-09-25 04:36:32 74

原创 utils->js->ecma->date(工具)

/** * 时间戳转化成时间 * @param {(Object|string|number)} time * @param {string} cFormat * @returns {string | null} */export function parseTime(time, cFormat) { if (arguments.length === 0 || !time) { return null } const format = cFormat |...

2021-09-25 04:26:55 88

原创 utils->frame->vue->路由导航守卫

//beforeEach,beforeResolve,afterEach合称路由守卫router.beforeEach(async (to, from, next) => { NProgress.start(); document.title = getPageTitle(to.meta.title); const hasRoles = store.getters.roles && store.getters.roles.length > 0; ..

2021-09-25 04:24:13 63

原创 utils->frame->vue->directive->dialog中可拖拽

/** * 可拖拽 * <el-dialog v-el-drag-dialog :visible.sync="dialogTableVisible" title="Shipping address" @dragDialog="handleDrag"> <el-select ref="select" v-model="value" placeholder="请选择"> <el-option v-for="item in options" :ke..

2021-09-25 04:21:59 65

原创 utils->frame->vue->directive->element中table底部间距

/** * How to use * <el-table height="100px" v-el-height-adaptive-table="{bottomOffset: 30}">...</el-table> * el-table height is must be set * bottomOffset: 30(default) // The height of the table from the bottom of the page. */import ad.

2021-09-25 04:15:42 314

原创 utils->frame->vue->directive->根据角色权限显示元素

// 权限相关import permission from './permission'const install = function(Vue) { Vue.directive('permission', permission)}if (window.Vue) { window['permission'] = permission Vue.use(install); // eslint-disable-line}permission.install = installex.

2021-09-25 04:13:04 41

原创 utils->frame->vue->directive->按钮水波纹效果

/*<el-button v-waves type="primary">水波纹效果</el-button>*/ import waves from './waves'const install = function(Vue) { Vue.directive('waves', waves)}if (window.Vue) { window.waves = waves Vue.use(install); // eslint-disable-line}.

2021-09-25 04:10:57 198

原创 utils->frame->vue->directive->textarea文本框根据输入内容自适应高度

/* <textarea v-grow-height="60" id="textarea" maxlength="500" placeholder="请输入作品描述,不超过500字" v-model="data"></textarea> */import textareaDrowAuto from './textareaDrowAuto'const install = function(Vue) { Vue.directive('textareadrowau.

2021-09-25 04:07:30 70

原创 utils->plugin->百度初始化对象

<template> <div id="mapRoot"></div></template><script>var timer;var map = "";export default { filters: {}, props: {}, data() { return { type: 0, }; }, watch: {}, created() {}, mounted() { .

2021-09-25 03:59:55 69

原创 utils->plugin->echart

盘<template><!-- <piechart :fontratio="fontRatio" :data="echart_agestuctureData" :theme="basedata.agestuctureTitle" :color="['#C00000', '#DF190F', '#EE1602', '#F73935', '#FB5A57

2021-09-25 03:53:16 64

原创 utils->js->ecma->array 根据某个属性排序

/* 对象数组根据某个属性来排序auth:yctime:19/11/18params:newArr,propertyreturn:newArr排序完的数组*/export function sortObjArray(newArr, property) { newArr.sort(function (a, b) { var str1Length = a[property].length; var str2Length = b[property].length; va.

2021-09-24 11:42:24 350

原创 utils->frame->vue->redux(实例)

/** * app级状态值,例如左滑动栏 */import Cookies from 'js-cookie'const state = { sidebar: { opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true,//左滑动栏开关 withoutAnimation: false//左滑动栏是使用动画,无用 }, device: 'desktop', siz...

2021-09-24 11:32:14 61

原创 utils->js->bomObject->兼容集合

// ie与chromne 事件兼容// 事件绑定兼容addEventListener() || attachEvent()// 取消事件绑定: removeEventListener() || detachEvent()// 获取事件对象: ev || window.event// 获取鼠标按键: ev.button || ev.which// 获取点击元素: ev.target || ev.srcElement// 获取键盘按键: ev.keyCode || ev.which

2021-09-24 11:13:36 36

原创 utils->frame->vue->elementUI_bug函数集合(工具类函数)

// dialog 中有一个dropdown组件,防止elemenet 中的dropdown组件中的项在上下滚动中出现在dialog的border外部let lock = true;let el = null;const MousedownEvent = new Event('mousedown', {bubbles:true});const MouseupEvent = new Event('mouseup', {bubbles:true});const fakeClickOutSid...

2021-09-24 10:56:38 92

原创 utils->js->bomObject->axios函数集合(工具类函数)

import axios from "axios";// create an axios instanceconst service = axios.create({ baseURL: "", //configParam.baseUrl, // url = base url + request url timeout: 5000});service.interceptors.request.use( config => { if (config.url.indexOf(.

2021-09-24 10:52:41 56

原创 utils->js->bomObject->location函数集合(工具类函数)

/** * 返回浏览器上的param函数 * @export * @param {any} name * @return */export function getQueryString(name){ var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.href.includes("?")?window.location.href.split('?').

2021-09-24 10:47:50 122

原创 utils->js->bomObject->event函数集合

/** * 防抖-谓防抖,就是指触发事件后在 n 秒内函数只能执行一次,如果在 n 秒内又触发了事件,则会重新计算函数执行时间。 * this.$_resizeHandler = debounce(() => { this.resize() }, 100) * @param {Function} func * @param {number} wait * @param {boolean} immediate * @return {*} */export function .

2021-09-24 10:46:07 45

原创 utils->js->bomObject->image函数集合(工具类函数)

/*图片链接转化成base64convertImgToBase64('http://bit.ly/18g0VNp', function(base64Img){});*/ export function convertImgToBase64(url, callback, outputFormat){ var canvas = document.createElement('CANVAS'), ctx = canvas.getContext('2d'), img = new Im.

2021-09-24 10:38:55 39

原创 utils->js->bomObject->dom函数集合(工具类函数)

/** * 前置省略号 * lineNum 函数 * tagele 目标dom */function linelip(lineNum, tagele) { var eles = document.getElementsByClassName(tagele); var lineNum = lineNum || 2; for (var i = 0; i < eles.length; i++) { var element = eles[i]; var text = e.

2021-09-24 10:37:13 79

原创 utils->js->bomObject->bom函数集合(工具类函数)

/** *打开浏览器 * @param {Sting} url * @param {Sting} title * @param {Number} w * @param {Number} h */export function openWindow(url, title, w, h) { // Fixes dual-screen position Most browsers Firefox const dualScre.

2021-09-24 10:28:59 69

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除