FE
文章平均质量分 53
M18771556987
M18771556987
展开
-
m进制转n进制
//n进制转m进制function bandExchange(number,nBand,mBand){ var tempArr = []; var tempNumber = 0; function conversionDecimal(number,nBand){ for(var i=0;i<number.length;i++){ tempNumber+=Number(number.charAt(number.length-i-1))*.原创 2020-07-01 14:23:55 · 197 阅读 · 0 评论 -
uVIew random 随机生成一个m~n的数字
function random(min, max) { if (min >= 0 && max > 0 && max >= min) { let gab = max - min + 1; // 偏移量+base基准值 return Math.floor(Math.random() * gab + min); } else { return 0; }}原创 2020-06-29 11:17:00 · 210 阅读 · 0 评论 -
element form 右上角错误提示
<template> <div id="app" class="form-xxx" style="padding: 50px; width: 500px;margin: 0 auto;"> <el-form :model="ruleForm" :rules="rules" label-position="top" size="small" ref="ru...原创 2020-03-14 14:41:48 · 1486 阅读 · 0 评论 -
sessionStorage 数据遍历,sessionStrage 获取所有key
var sessionKeys = Object.keys(sessionStorage)for (var i=0;i<sessionKeys.length;i++) { console.log(sessionStorage.getItem(sessionKeys[i]))}原创 2020-03-14 12:43:44 · 5589 阅读 · 0 评论 -
element ui form 行内错误提示
<template> <div id="app"> <el-form :model="ruleForm" :rules="rules" label-position="right" size="small" ref="ruleForm" label-width="100px" class="demo-ruleForm"> <el-...转载 2020-03-13 21:22:05 · 5580 阅读 · 0 评论 -
element ui form 验证例子
<template> <div id="app"> <el-form :model="ruleForm" :rules="rules" label-position="top" ref="ruleForm" label-width="100px" class="demo-ruleForm"> <el-form-item label...原创 2019-06-26 10:45:02 · 597 阅读 · 0 评论 -
BYTE, KB, MB,GB,TB,灵活转换
<script type="text/javascript">/** * byteSize number required * opt {} options * startUnit BYTE * use like this * conversion(1024*1024*1024) =>1GB * conversion(1...原创 2019-05-29 16:37:47 · 408 阅读 · 0 评论 -
H5 图片翻动效果
H5图片翻动效果<style>* { margin: 0; padding: 0;}html, body, #app { width: 100%; height: 100%; overflow: hidden; position: relative;}img { width: 100%; height: 100%; display: block;}...原创 2019-05-15 19:45:48 · 3241 阅读 · 0 评论 -
svg clip-path 裁剪动画
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> <style> .love-heart path { fill: none;...原创 2019-05-15 15:03:15 · 939 阅读 · 0 评论 -
Vue provide&inject
通过学习element ui collapase 组件,来学习provide和injectprovide 提供出来inject 注入进来由父级组件提供出来,子级组件注入a.el-collapse 父组件, 提供provide<template> <div class="el-collapse" role="tablist" aria-multisel...原创 2019-05-10 11:39:40 · 312 阅读 · 0 评论 -
正则表达式 \1
var testStr = ["HHHDDFFFFFFF", "HHHDFFFFFFF", "FFHHHDFFFFFFF", "FFDFFFFFFF"];function codeStr(str) { var mapObj = [] var reg = /(H|D|F)(\1*)/g; var curMatch; while(curMatch = reg...原创 2019-05-14 09:34:47 · 1344 阅读 · 0 评论 -
element emmiter.js
element/src/mixins/emmiter.jsfunction broadcast(componentName, eventName, params) { this.$children.forEach(child => { var name = child.$options.componentName; if (name === componentNa...原创 2019-04-04 19:11:57 · 749 阅读 · 0 评论 -
element ui form 验证机制
el-form作为包裹el-form-item层,el-form-item作为el-input,el-datepicker,el-radio等包裹成组件(可以暂时理解为父组件)el-form1 首先来学习一下el-form的实现,el-form具备如下a,b功能a.承接对el-form-item加入,移除的监听。b.使用validate包装循环el-form-item valida...原创 2019-04-04 10:32:23 · 3981 阅读 · 0 评论 -
$router来历, $store来历,vue 插件机制, vue-router,vue-vuex
1.使用Vuex,Vue.use(Vuex),搞明白Vue.use 都做了什么Vue 源码src/core/global-api/use.js/* @flow */import { toArray } from '../util/index'export function initUse (Vue: GlobalAPI) { Vue.use = function (plugi...原创 2019-03-26 10:46:50 · 1492 阅读 · 0 评论 -
typescript decorator 装饰器
function f(xx) { console.log("f(): evaluated"); return function (target, propertyKey: string, descriptor: PropertyDescriptor) { console.log("f(): called", xx); }}function g() {...原创 2019-01-18 13:41:23 · 434 阅读 · 0 评论 -
canvas 鼠标绘制任意多边形形状
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> <style> * { margin: 0; pad...原创 2019-01-18 09:43:29 · 6522 阅读 · 10 评论 -
红包动画
<!DOCTYPE html><html lang="en" data-dpr="1" style="font-size: 32px;"><head> <meta charset="UTF-8"> <title>Document</title> <meta name="viewport" c...原创 2020-03-10 16:46:50 · 281549 阅读 · 0 评论 -
svg 绘制流程图
用到的知识svg marker(结合marker-end), path上使用marker-end指向定义defs中的marker这个比较厉害箭头Vue.component('flowMapGuide', { template: `<div> <svg ref="rootSvg" xmlns="http://www.w3.org/2000/svg" x...原创 2018-09-27 14:03:29 · 4515 阅读 · 0 评论 -
双向绑定 angular vs vue
angular 双向绑定子组件定义import {Component,forwardRef, EventEmitter, Input, Output } from '@angular/core';import {ControlValueAccessor,NG_VALUE_ACCESSOR} from '@angular/forms'@Component({ selector:'t...原创 2018-07-18 19:11:59 · 561 阅读 · 0 评论