1.ä¸çå°±ä¼çè¶
å®ç¨å°ç»ä»¶ä¹LoadingButton
2.网页播放flash的进度条代码?
3.手把手Element UI&Plus里Loading的极致封装!只需0.5行超简洁使用
4.求一个flash loading源代码
5.Rematch 源码系列四、源码 礼包码Third-Party plugins
ä¸çå°±ä¼çè¶ å®ç¨å°ç»ä»¶ä¹LoadingButton
ç»ä»¶èæ¯
å¨å¹³æ¶çå·¥ä½ä¸ï¼ç»å¸¸ä¼éå°ä¸ä¸ªåºæ¯ï¼
ç¹å»æé®æ¶è¯·æ±ä¸äºæ¥å£æ°æ®ï¼è为äºé¿å ç¨æ·éå¤çç¹å»æ们é常ä¼ä¸ºè¿äºæé®æ·»å loadingãè¿ä¸ªæ·»å loadingçåè½æ¬èº«æ¶é常ç®åçï¼åªè¦æ们å®ä¹ä¸ä¸ªåé使ç¨å¨Buttonç»ä»¶ä¸å³å¯ï¼ä½å¨ååå°ç®¡ç类项ç®æ¶ï¼è¿æ ·çæé®å¯è½ä¼æé常é常å¤ï¼å¯è½ä¸ä¸ªç»ä»¶ä¸ï¼å¾å¤åéé½æ¯xxx_loadingï¼èæ¶èååä¸å¤ä¼é ãæ¥ä¸æ¥ï¼æ们对Buttonç»ä»¶åä¸ä¸ªç®åçå°è£ æ¥è§£å³è¿ä¸ªèæ¶èååä¸å¤ä¼é çloadingé®é¢
çµææ¥æºæ们å¨ä½¿ç¨AntdçModal对è¯æ¡æ¶ï¼å½æ们çonOk为å¼æ¥å½æ°æ¶ï¼æ¤æ¶Modalçç¡®å®æé®ä¼èªå¨æ·»å loadingææï¼å¨å½æ°æ§è¡å®æåå ³éå¼¹çªï¼å°±åè¿æ ·ï¼æ¤æ¶ï¼ä»£ç å¦ä¸ï¼
asyncFunc(){ returnnewPromise(resolve=>{ setTimeout(()=>{ resolve()},css魔方旋转源码)})},handleTestModal(){ constthat=thisthis.$confirm({ title:'æµè¯å¼æ¥å½æ°',content:'å¼æ¥å½æ°å»¶è¿ä¸¤ç§ç»æ',asynconOk(){ awaitthat.asyncFunc()}})},çå°è¿ç§ææåï¼å°±æ³å°ï¼å¦æå¯ä»¥å°è£ ä¸ä¸ªButtonç»ä»¶ï¼å°éè¦æ§è¡çå½æ°ä¼ å ¥ï¼ç»ä»¶ä¸èªå¨æ ¹æ®å½æ°æ§è¡æ åµæ·»å loadingææå²ä¸æ¯é常çæ¹ä¾¿ã
å®ç°LoadingButtonå®ä¹ç»ä»¶åæ°è¿è¾¹å°±å®ä¹å 个大家ä¼å¸¸ç¨å°çåæ°ï¼text(æé®æå)ãtype(æé®ç±»å)ãasyncFunc(æé®ç¹å»æ¶æ§è¡çå¼æ¥å½æ°)ãdelay(loading延è¿)ï¼å¦å¤ï¼è¿éè¦ä¸ä¸ªç»ä»¶å é¨çloadingåéæ¥æ§å¶æ们Buttonç»ä»¶çç¶æï¼ä»£ç å¦ä¸ï¼
exportdefault{ data(){ return{ loading:false}},props:{ text:{ type:String,default:'ç¡®å®'},type:{ type:String,default:'primary'},delay:{ type:Number,default:0},asyncFunc:{ type:Function,default:()=>{ }}},}使ç¨antdä¸çButtonç»ä»¶è¿è¡äºæ¬¡å°è£å¨æ们çèªå®ä¹LoadingButtonç»ä»¶ä¸ï¼å°ä¸é¢å®ä¹çåæ°ä½¿ç¨èµ·æ¥ï¼å¹¶ç»å®ä¸ä¸ªclickäºä»¶ï¼ä»£ç å¦ä¸ï¼
<template><Button:type="type":loading="loading"@click="handleClick">{ { text}}</Button></template><script>import{ Button}from'ant-design-vue'exportdefault{ components:{ Button},methods:{ handleClick(){ }}}</script>å¤æå¼æ¥å½æ°asyncFuncè¿ä¸é¨å为æ´ä¸ªç»ä»¶æéè¦çä¸ä¸ªé¨åï¼å³æ们å¦ä½å»å¤æä¼ å ¥çå½æ°æ¯å¼æ¥å½æ°ï¼å½æä»¬ä¼ å ¥çasyncFuncå½æ°æ¯å¼æ¥å½æ°æ¶ï¼ç»ä»¶æéè¦æ·»å loadingçå¨ç»ï¼é£ä¹æ们åºè¯¥å¦ä½å»å¤æä¸ä¸ªå½æ°æ¯å¦ä¸ºå¼æ¥å½æ°å¢ï¼
åèantdæ¯å¦ä½å®ç°çï¼ä¸é¢æ们åä»ç»äºantdçModal对è¯æ¡ä¸æ类似çé»è¾ï¼é£ä¹ä¸å¦¨å»é 读ä¸ä¸è¿é¨åç¸å ³çæºç ï¼çä¸antdçå®ç°æ¹å¼ï¼
//components/modal/ActionButton.jsxonClick(){ const{ actionFn,closeModal}=this;if(actionFn){ letret;if(actionFn.length){ ret=actionFn(closeModal);}else{ ret=actionFn();if(!ret){ closeModal();}}if(ret&&ret.then){ this.setState({ loading:true});ret.then((...args)=>{ //It'sunnecessarytosetloading=false,fortheModalwillbeunmountedafterclose.//this.setState({ loading:false});closeModal(...args);},e=>{ //Emiterrorwhencatchpromisereject//eslint-disable-next-lineno-consoleconsole.error(e);//See:/post/网页播放flash的进度条代码?
var myLoading:MovieClip;
var loadInfo:MovieClip;
var _lineBgcolor = "0x";
var _lineColor = "0xFF";
var _lineLen:Number = ;
var _lineH:Number = 3;
var _txtColor; var _txtAlign:String = "center";
var tb:Number;
var txtFormat:TextFormat = new TextFormat
("Arial", null, 0xffffff, true); myLoading = _root.createEmptyMovieClip("myLoading",); //进度条
loadInfo = myLoading.createEmptyMovieClip("line", );
loadInfo.lineStyle(1, _lineColor, );
loadInfo.moveTo(0, 0);
loadInfo.lineTo(_lineLen, 0);
loadInfo.lineTo(_lineLen, _lineH);
loadInfo.lineTo(0, _lineH);
loadInfo.lineTo(0, 0); //进度显示文本
loadInfo.createTextField("txt", , 0, 0, _lineLen, );
loadInfo.txt.autoSize = _txtAlign; //设置进度条的位置(居中于主场景)
loadInfo._x = (Stage.width - _lineLen)/2;
loadInfo._y = Stage.height/2; //获得影片大小并stop,再onEnterFrame
tb = _root.getBytesTotal();
_root.stop();
myLoading.onEnterFrame = function(){
var lb:Number = _root.getBytesLoaded();
var percent:Number = Math.round(lb/tb*);
loadInfo.txt.text = percent+"%";
loadInfo.txt.setTextFormat(txtFormat);
loadInfo.lineStyle(_lineH,端口转发易源码 _lineBgcolor, );
loadInfo.moveTo(0, _lineH/2);
loadInfo.lineTo(percent*_lineLen/, _lineH/2);
if (percent == ) {
_root.play();
delete this.onEnterFrame;
loadInfo.clear();
loadInfo.txt.text = "";
}
}