亚洲中字慕日产2020,大陆极品少妇内射AAAAAA,无码av大香线蕉伊人久久,久久精品国产亚洲av麻豆网站

資訊專欄INFORMATION COLUMN

看完你也想編寫自己的 react 插件

Vixb / 1963人閱讀

摘要:清楚自己想要什么樣的組件,就自己動手擼唄。咱們先來看看它的效果吧如果大家有時間,窩還是鼓勵大家自己動手實現(xiàn)一些小插件。于是自己就琢磨能否繼承使用方法同時保持特有組件特性。需要確保已安裝。

副標題----為什么我要寫這個 react 插件

圖片懶加載是項目中常用的功能,然而現(xiàn)有 react 懶加載組件庫,用著都不是很爽了 ?。概括一下有如下幾點:

沒有只針對 image 懶加載組件。多數(shù)組件庫都內(nèi)置了模塊、組件、腳本、iframe 懶加載功能,而弱化了 image 懶加載功能。

不支持動畫顯示效果。

不靈活,可配置度不高。

placeholder 不能組件化。

不支持響應式圖片( picture / srcset )。

react-lazyimg-component

清楚自己想要什么樣的組件,就自己動手擼唄 ?。于是乎,react-lazyimg-component 就誕生了 ?。咱們先來看看它的效果吧:

singsong: 如果大家有時間,窩還是鼓勵大家自己動手實現(xiàn)一些小插件。

PC 預覽:

使勁猛擊這里

手機預覽(掃一掃):

什么情況需要使用它 1. 小巧輕便,簡單易用,基本無學習成本

在那個 jQuery 一統(tǒng)天下的年代,擼代碼就用 jQuery 一把梭。其中
jQuery.lazyload 是一個很常用圖片懶加載插件。 可能很多像我一樣的小伙伴們,懶加載就直接上 jQuery.lazyload,早已習慣了 jQuery.lazyload 使用。 于是自己就琢磨能否繼承 jQuery.lazyload 使用方法同時保持 react 特有組件特性。這樣可以很快上手~?

singsong: 這里只是繼承了 jQuery.lazyload 配置特性,不是完全繼承。畢竟 jQuery 與現(xiàn)在主流的 MVVM 框架思想截然不同。

如果小伙伴們熟悉 jQuery.lazyload , 完全沒有學習成本直接上手 react-lazyimg-component 哈。 只說不是寫,然并卵。那我們來看看它到底好用不:

安裝
// npm
$> npm install react-lazyimg-component
// yarn
$> yarn add react-lazyimg-component
使用
// 引入
import Lazyimg, { withLazyimg } from "react-lazyimg-component";

// 調(diào)用
;

是不是很簡單,有木有 ?。上述只是使用 react-lazyimg-component 的默認配置。 這里我們可以通過配置項來定制懶加載的行為:

// 引入 lazyimg
import Lazyimg, { withLazyimg } from "react-lazyimg-component";
// 引入 volecity.js
import "velocity-animate";
import "velocity-animate/velocity.ui";

// 配置
const config = {
  threshold: 100, // 指定觸發(fā)閾值
  js_effect: "transition.fadeIn", // 支持 velocity.js 動畫效果
};
// 基于配置項生成對應 Lazy 組件
const Lazy = withLazyimg(config);

// 調(diào)用
;

接下來我們來看看 react-lazyimg-component 都那些配置項:

threshold: 0, // 指定距離底部多少距離時觸發(fā)加載
event: "scroll", // 指定觸發(fā)事件,默認為"scroll"
js_effect: undefined, // 顯示圖片的js動畫效果
css_effect: undefined, // 顯示圖片的css動畫效果
container: window, // 指定容器,默認為window
parent: undefined, // 可以指定動畫效果作用于元素的哪個父級元素
appear: null, // 元素出現(xiàn)在可視窗口時觸發(fā)appear鉤子函數(shù)
load: null,  // 元素圖片的加載完后觸發(fā)load鉤子函數(shù)
error: null, // 圖片加載出錯時觸發(fā)error鉤子函數(shù)
node_type: "img", // 指定生成的節(jié)點類型,默認為"img"
placeholder: // 占位元素,除了支持普通的圖片外,還支持react組件。
  "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC",

是不是很眼熟 ?,如果你熟悉 jquery.lazyload,那么你只需了解如下幾個配置項即可:

js_effect: 指定元素顯示的動畫效果,基于velocity.js動畫實現(xiàn)。使用之前需加載velocity.js。

css_effect: 指定元素顯示的動畫效果,基于animate.css動畫實現(xiàn)。使用之前需安裝animate.css

parent: 用于指定動畫效果作用于元素的哪個父級元素??扇≈担?/p>

父元素的 selector 選擇器(字符串)

父級層級 level(整數(shù))

node_type: 指定 react 將生成的元素類型,默認為"img"。

placeholder: 占位元素,除了支持普通的圖片外,還支持 react 組件。

2. 支持 velocity.js、animate.css 動畫效果庫,及自定動畫效果。同時還支持動畫效果作用于父級元素。

指定 js-effect 配置項來配置 velocity.js 動畫效果

注意:js-effect 依賴于 velocity.js。需要確保 velocity.js 已加載。
// 引入 lazyimg
import Lazyimg, { withLazyimg } from "react-lazyimg-component";
// 引入 volecity.js
import "velocity-animate";
import "velocity-animate/velocity.ui";
// 配置
const config = {
  placeholder: "loading.svg",
  js_effect: "transition.fadeIn", // 支持 velocity.js 動畫效果
};
const Lazy = withLazyimg(config);
// 調(diào)用
;

直接上效果了 ?

指定 css-effect 配置項來配置 animate.css 動畫效果

注意:css-effect 依賴于 animate.css。需要確保 animate.css 已安裝。
  // 配置
  const config = {
    js_effect="transition.flipXIn" // 不會生效
    css_effect={["animated", "rollIn"]} // 定制 css 動畫效果
  };
  const Lazy = withLazyimg(config);
  // 調(diào)用
  ;

直接上效果了 ?

指定 parent 配置項指定父級元素動畫效果

singsong: 為什么懶加載的動畫效果只作用于目標元素,某些條件下作用于目標元素的父級元素會有意想不到效果哦 ?。
// 指定動畫效果作用于該父級元素 <div id="dnkpnhlp" className="example-img"> <Lazyimg className="lazy" src={"http://zhansingsong.github.io/lazyimg/22.4582fc71.jpg"} css_effect={["animated", "flipInY"]} // 定制 css 動畫效果 parent=".example" // 指定父級元素選擇器,也可以指定父級層級level:2 /> </div> </div></pre> <p>直接上效果了 ?</p> <p><script type="text/javascript">showImg("https://segmentfault.com/img/remote/1460000013614823?w=706&h=755");</script></p> <b>3. react 組件式 placeholder</b> <pre>singsong: 傳統(tǒng)的 placeholder 通常都是由圖片來代替,為什么不能用組件來定制,這樣可擴展性更高。完全可以擺脫設計師的束縛,咋們開發(fā)自由發(fā)揮?! 想想有木有有點小雞凍 ?<del>~</del>~</pre> <p>先定義 placeholder 組件</p> <pre>import React from "react"; import "./style.scss"; export default props => { let { className, text, img, children } = props; return ( <div className={["placeholder", className] .filter(item => { if (item) { return item; } }) .join(" ")} > {img && } {text && <span id="dnkpnhlp" className="placeholder-text">{children || text}</span>} </div> ); };</pre> <p>指定 placeholder 配置項為上述定義的 placeholder 組件</p> <pre>// 配置 const Lazy = withLazyimg({ js_effect: "transition.perspectiveDownIn", placeholder: <Placeholder img={require("./loading.svg")} />, }); // 調(diào)用 <Lazy className="lazy" src={"http://zhansingsong.github.io/lazyimg/22.4582fc71.jpg"} />;</pre> <p>直接上效果了 ?</p> <p><script type="text/javascript">showImg("https://segmentfault.com/img/remote/1460000013614824?w=702&h=851");</script></p> <pre>singsong: 圖中小火焰有木有很耀眼<del>~</del> </pre> <p>接著咋們來看看組件式 placeholder 應用場景案例,直接上效果了 ?</p> <p><script type="text/javascript">showImg("https://segmentfault.com/img/remote/1460000013614825?w=371&h=669");</script></p> <p>上圖是分類頁通過定制顯示文案的 placeholder 組件來代替普通的灰色圖片,效果是不是看著還行 ?。這是我在實際項目中使用的案例。這里小伙伴可以自由發(fā)揮哈<del>~</del>。如果你有不錯 idea 可以@我哈,先謝了!</p> <b>4. 響應式圖片( picture / srcset )</b> <p>為了實現(xiàn) web 應用的極致體驗,Progressive Web App 漸進式網(wǎng)頁應用程序越來越受到開發(fā)者們重視,其中響應式圖片就是其中一個重要技術(shù)項。為了跟著大部隊,咋們也需要了解了解噢!</p> <p>srcset 特性實現(xiàn)響應式圖片</p> <pre> // dpr <Lazyimg className="lazy" src={"http://zhansingsong.github.io/lazyimg/22.4582fc71.jpg"} srcSet="source_1x.png 1x, source_2x.png 2x, source_3x.png 3x, source_3.5x.png 3.5x" js_effect="transition.bounceIn" /></pre> <p>直接上效果了 ?</p> <p><script type="text/javascript">showImg("https://segmentfault.com/img/remote/1460000013614826?w=480&h=577");</script></p> <pre>singsong: 這里 srcset 配合 sizes 特性可以實現(xiàn)更好的效果</pre> <p>picture 元素實現(xiàn)響應式圖片</p> <pre> <picture> <source media="(min-width: 650px)" srcSet="https://www.w3schools.com/tags/img_pink_flowers.jpg" /> <source media="(min-width: 465px)" srcSet="https://www.w3schools.com/tags/img_white_flower.jpg"/> <Lazyimg className="lazy" src={"http://zhansingsong.github.io/lazyimg/22.4582fc71.jpg"} js_effect="transition.expandIn" /> </picture></pre> <p>直接上效果了 ?</p> <p><script type="text/javascript">showImg("https://segmentfault.com/img/remote/1460000013614827");</script></p> <b>后語</b> <p>這個插件是我由項目中提煉出的,個人用著還挺順手,就拿出與大家分享分享。另外,畢竟個人能力有限,如果你發(fā)現(xiàn)插件有問題或有什么好的建議,也請告知一下,先這里謝過了 ?。最后歡迎star?、歡迎watch?、歡迎fork?</p> </div> <div id="dnkpnhlp" class="mt-64 tags-seach" > <div id="dnkpnhlp" class="tags-info"> <a style="width:120px;" title="云服務器" href="http://www.ezyhdfw.cn/site/active/kuaijiesale.html?ytag=seo">云服務器</a> <a style="width:120px;" title="GPU云服務器" href="http://www.ezyhdfw.cn/site/product/gpu.html">GPU云服務器</a> <a style="width:120px;" title="自己編寫的小程序" href="http://www.ezyhdfw.cn/yun/tag/zijibianxiedexiaochengxu/">自己編寫的小程序</a> <a style="width:120px;" title="在js中怎樣編寫插件" href="http://www.ezyhdfw.cn/yun/tag/zaijszhongzenyangbianxiechajian/">在js中怎樣編寫插件</a> <a style="width:120px;" title="自己編寫web服務器" href="http://www.ezyhdfw.cn/yun/tag/zijibianxiewebfuwuqi/">自己編寫web服務器</a> <a style="width:120px;" title="自己編寫云服務器搶紅包" href="http://www.ezyhdfw.cn/yun/tag/zijibianxieyunfuwuqiqianghongbao/">自己編寫云服務器搶紅包</a> </div> </div> <div id="dnkpnhlp" class="entry-copyright mb-30"> <p class="mb-15"> 文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。</p> <p>轉(zhuǎn)載請注明本文地址:http://www.ezyhdfw.cn/yun/115778.html</p> </div> <ul class="pre-next-page"> <li id="dnkpnhlp" class="ellipsis"><a class="hpf" href="http://www.ezyhdfw.cn/yun/115777.html">上一篇:【CSS基礎】CSS常見問題</a></li> <li id="dnkpnhlp" class="ellipsis"><a class="hpf" href="http://www.ezyhdfw.cn/yun/115779.html">下一篇:用CSS3實現(xiàn)鐘表效果</a></li> </ul> </div> <div id="dnkpnhlp" class="about_topicone-mid"> <h3 class="top-com-title mb-0"><span data-id="0">相關(guān)文章</span></h3> <ul class="com_white-left-mid atricle-list-box"> <li> <div id="dnkpnhlp" class="atricle-list-right"> <h2 class="ellipsis2"><a class="hpf" href="http://www.ezyhdfw.cn/yun/93278.html"><b><em>看完</em><em>你<em>也想</em></em><em>編寫</em><em>自己</em><em>的</em> <em>react</em> <em>插件</em></b></a></h2> <p class="ellipsis2 good">摘要:清楚自己想要什么樣的組件,就自己動手擼唄。咱們先來看看它的效果吧如果大家有時間,窩還是鼓勵大家自己動手實現(xiàn)一些小插件。于是自己就琢磨能否繼承使用方法同時保持特有組件特性。需要確保已安裝。 副標題----為什么我要寫這個 react 插件 圖片懶加載是項目中常用的功能,然而現(xiàn)有 react 懶加載組件庫,用著都不是很爽了 ?。概括一下有如下幾點: 沒有只針對 image 懶加載組件。多...</p> <div id="dnkpnhlp" class="com_white-left-info"> <div id="dnkpnhlp" class="com_white-left-infol"> <a href="http://www.ezyhdfw.cn/yun/u-1484.html"><img src="http://www.ezyhdfw.cn/yun/data/avatar/000/00/14/small_000001484.jpg" alt=""><span id="dnkpnhlp" class="layui-hide64">zhou_you</span></a> <time datetime="">2019-08-22 15:13</time> <span><i class="fa fa-commenting"></i>評論0</span> <span><i class="fa fa-star"></i>收藏0</span> </div> </div> </div> </li> <li> <div id="dnkpnhlp" class="atricle-list-right"> <h2 class="ellipsis2"><a class="hpf" href="http://www.ezyhdfw.cn/yun/51949.html"><b><em>看完</em><em>你<em>也想</em></em><em>編寫</em><em>自己</em><em>的</em> <em>react</em> <em>插件</em></b></a></h2> <p class="ellipsis2 good">摘要:清楚自己想要什么樣的組件,就自己動手擼唄。咱們先來看看它的效果吧如果大家有時間,窩還是鼓勵大家自己動手實現(xiàn)一些小插件。于是自己就琢磨能否繼承使用方法同時保持特有組件特性。需要確保已安裝。 副標題----為什么我要寫這個 react 插件 圖片懶加載是項目中常用的功能,然而現(xiàn)有 react 懶加載組件庫,用著都不是很爽了 ?。概括一下有如下幾點: 沒有只針對 image 懶加載組件。多...</p> <div id="dnkpnhlp" class="com_white-left-info"> <div id="dnkpnhlp" class="com_white-left-infol"> <a href="http://www.ezyhdfw.cn/yun/u-506.html"><img src="http://www.ezyhdfw.cn/yun/data/avatar/000/00/05/small_000000506.jpg" alt=""><span id="dnkpnhlp" class="layui-hide64">xingpingz</span></a> <time datetime="">2019-08-01 18:40</time> <span><i class="fa fa-commenting"></i>評論0</span> <span><i class="fa fa-star"></i>收藏0</span> </div> </div> </div> </li> <li> <div id="dnkpnhlp" class="atricle-list-right"> <h2 class="ellipsis2"><a class="hpf" href="http://www.ezyhdfw.cn/yun/124521.html"><b>沒有基礎或者基礎差,如何快速學會編程?這6招絕對好使</b></a></h2> <p class="ellipsis2 good">摘要:第一點,先清楚你的目的你學編程想要做什么你對哪方面感興趣然后去百度查一下哪些編程語言適合做那個方向,帶著目的去學習,如果一開始沒選好,中途掉頭就很可惜了。 你是不是...</p> <div id="dnkpnhlp" class="com_white-left-info"> <div id="dnkpnhlp" class="com_white-left-infol"> <a href="http://www.ezyhdfw.cn/yun/u-255.html"><img src="http://www.ezyhdfw.cn/yun/data/avatar/000/00/02/small_000000255.jpg" alt=""><span id="dnkpnhlp" class="layui-hide64">EasonTyler</span></a> <time datetime="">2021-11-23 09:51</time> <span><i class="fa fa-commenting"></i>評論0</span> <span><i class="fa fa-star"></i>收藏0</span> </div> </div> </div> </li> <li> <div id="dnkpnhlp" class="atricle-list-right"> <h2 class="ellipsis2"><a class="hpf" href="http://www.ezyhdfw.cn/yun/84471.html"><b>前端周刊第64期:你真<em>的</em>會提問么?</b></a></h2> <p class="ellipsis2 good">摘要:但是究竟什么是區(qū)塊鏈呢如何基于區(qū)塊鏈構(gòu)建去中心化的應用這個系列文章很有料,有圖文解釋有代碼實例,非常適合入門。想知道我接下來會寫些什么歡迎訂閱我的掘金專欄或知乎專欄前端周刊讓你在前端領(lǐng)域跟上時代的腳步。 showImg(https://segmentfault.com/img/remote/1460000010417511); 共 2044 字,讀完需 4 分鐘。本期以《提問的智慧》作...</p> <div id="dnkpnhlp" class="com_white-left-info"> <div id="dnkpnhlp" class="com_white-left-infol"> <a href="http://www.ezyhdfw.cn/yun/u-649.html"><img src="http://www.ezyhdfw.cn/yun/data/avatar/000/00/06/small_000000649.jpg" alt=""><span id="dnkpnhlp" class="layui-hide64">wfc_666</span></a> <time datetime="">2019-08-20 18:25</time> <span><i class="fa fa-commenting"></i>評論0</span> <span><i class="fa fa-star"></i>收藏0</span> </div> </div> </div> </li> <li> <div id="dnkpnhlp" class="atricle-list-right"> <h2 class="ellipsis2"><a class="hpf" href="http://www.ezyhdfw.cn/yun/54096.html"><b>879本IT技術(shù)書籍(都<em>看<em>完你</em></em>就可以升仙兒了)</b></a></h2> <p class="ellipsis2 good">摘要:珍藏版收集了好幾年的書回過頭來一看真不少拿過來跟你們一起分享下載鏈接我也會在官網(wǎng)上發(fā)布視頻教程呀電影呀有用的資源你們懂得作者作者科技站長官網(wǎng)百度搜索科技博客公眾號搜索 珍藏版---收集了好幾年的書,回過頭來一看,真不少,拿過來跟你們一起分享 showImg(https://img-blog.csdnimg.cn/20181123115931741.png?x-oss-process=i...</p> <div id="dnkpnhlp" class="com_white-left-info"> <div id="dnkpnhlp" class="com_white-left-infol"> <a href="http://www.ezyhdfw.cn/yun/u-83.html"><img src="http://www.ezyhdfw.cn/yun/data/avatar/000/00/00/small_000000083.jpg" alt=""><span id="dnkpnhlp" class="layui-hide64">用戶83</span></a> <time datetime="">2019-08-02 15:23</time> <span><i class="fa fa-commenting"></i>評論0</span> <span><i class="fa fa-star"></i>收藏0</span> </div> </div> </div> </li> </ul> </div> <div id="dnkpnhlp" class="topicone-box-wangeditor"> <h3 class="top-com-title mb-64"><span>發(fā)表評論</span></h3> <div id="dnkpnhlp" class="xcp-publish-main flex_box_zd"> <div id="dnkpnhlp" class="unlogin-pinglun-box"> <a href="javascript:login()" class="grad">登陸后可評論</a> </div> </div> </div> <div id="dnkpnhlp" class="site-box-content"> <div id="dnkpnhlp" class="site-content-title"> <h3 class="top-com-title mb-64"><span>0條評論</span></h3> </div> <div id="dnkpnhlp" class="pages"></ul></div> </div> </div> <div id="dnkpnhlp" class="layui-col-md4 layui-col-lg3 com_white-right site-wrap-right"> <div id="dnkpnhlp" class=""> <div id="dnkpnhlp" class="com_layuiright-box user-msgbox"> <a href="http://www.ezyhdfw.cn/yun/u-1530.html"><img src="http://www.ezyhdfw.cn/yun/data/avatar/000/00/15/small_000001530.jpg" alt=""></a> <h3><a href="http://www.ezyhdfw.cn/yun/u-1530.html" rel="nofollow">Vixb</a></h3> <h6>男<span>|</span>高級講師</h6> <div id="dnkpnhlp" class="flex_box_zd user-msgbox-atten"> <a href="javascript:attentto_user(1530)" id="attenttouser_1530" class="grad follow-btn notfollow attention">我要關(guān)注</a> <a href="javascript:login()" title="發(fā)私信" >我要私信</a> </div> <div id="dnkpnhlp" class="user-msgbox-list flex_box_zd"> <h3 class="hpf">TA的文章</h3> <a href="http://www.ezyhdfw.cn/yun/ut-1530.html" class="box_hxjz">閱讀更多</a> </div> <ul class="user-msgbox-ul"> <li><h3 class="ellipsis"><a href="http://www.ezyhdfw.cn/yun/130963.html">estimator</a></h3> <p>閱讀 3565<span>·</span>2023-04-26 02:31</p></li> <li><h3 class="ellipsis"><a href="http://www.ezyhdfw.cn/yun/124498.html">排序之八大絕技</a></h3> <p>閱讀 3701<span>·</span>2021-11-23 09:51</p></li> <li><h3 class="ellipsis"><a href="http://www.ezyhdfw.cn/yun/123560.html">用剛學的Springboot去實現(xiàn)一個完整的倉庫管理系統(tǒng)</a></h3> <p>閱讀 1345<span>·</span>2021-11-17 09:33</p></li> <li><h3 class="ellipsis"><a href="http://www.ezyhdfw.cn/yun/123487.html">【經(jīng)驗分享】測試人員如何寫總結(jié)</a></h3> <p>閱讀 2506<span>·</span>2021-11-16 11:45</p></li> <li><h3 class="ellipsis"><a href="http://www.ezyhdfw.cn/yun/122224.html">Hostodo:美國VPS年付$45/年起,免費DirectAdmin面板,多機房多款套餐可選</a></h3> <p>閱讀 2625<span>·</span>2021-10-11 11:12</p></li> <li><h3 class="ellipsis"><a href="http://www.ezyhdfw.cn/yun/120420.html">云主機怎么設置密碼-云主機怎么使用?</a></h3> <p>閱讀 2497<span>·</span>2021-09-22 15:22</p></li> <li><h3 class="ellipsis"><a href="http://www.ezyhdfw.cn/yun/119071.html">Django3商城項目 從0到1 【五】商品信息模塊</a></h3> <p>閱讀 2794<span>·</span>2021-09-04 16:40</p></li> <li><h3 class="ellipsis"><a href="http://www.ezyhdfw.cn/yun/117879.html">搬瓦工新增荷蘭(聯(lián)通線路)VPS,2.5-10Gbps帶寬季付46.7美元起</a></h3> <p>閱讀 2647<span>·</span>2021-07-30 15:30</p></li> </ul> </div> <!-- 文章詳情右側(cè)廣告--> <div id="dnkpnhlp" class="com_layuiright-box"> <h6 class="top-com-title"><span>最新活動</span></h6> <div id="dnkpnhlp" class="com_adbox"> <div id="dnkpnhlp" class="layui-carousel" id="right-item"> <div carousel-item> <div> <a href="http://www.ezyhdfw.cn/site/active/kuaijiesale.html?ytag=seo" rel="nofollow"> <img src="http://www.ezyhdfw.cn/yun/data/attach/240625/2rTjEHmi.png" alt="云服務器"> </a> </div> <div> <a href="http://www.ezyhdfw.cn/site/product/gpu.html" rel="nofollow"> <img src="http://www.ezyhdfw.cn/yun/data/attach/240807/7NjZjdrd.png" alt="GPU云服務器"> </a> </div> </div> </div> </div> <!-- banner結(jié)束 --> <div id="dnkpnhlp" class="adhtml"> </div> <script> $(function(){ $.ajax({ type: "GET", url:"http://www.ezyhdfw.cn/yun/ad/getad/1.html", cache: false, success: function(text){ $(".adhtml").html(text); } }); }) </script> </div> </div> </div> </div> </div> </section> <!-- wap拉出按鈕 --> <div id="dnkpnhlp" class="site-tree-mobile layui-hide"> <i class="layui-icon layui-icon-spread-left"></i> </div> <!-- wap遮罩層 --> <div id="dnkpnhlp" class="site-mobile-shade"></div> <!--付費閱讀 --> <div class="dnkpnhlp" id="payread"> <div id="dnkpnhlp" class="layui-form-item">閱讀需要支付1元查看</div> <div id="dnkpnhlp" class="layui-form-item"><button class="btn-right">支付并查看</button></div> </div> <script> var prei=0; $(".site-seo-depict pre").each(function(){ var html=$(this).html().replace("<code>","").replace("</code>","").replace('<code class="javascript hljs" codemark="1">',''); $(this).attr('data-clipboard-text',html).attr("id","pre"+prei); $(this).html("").append("<code>"+html+"</code>"); prei++; }) $(".site-seo-depict img").each(function(){ if($(this).attr("src").indexOf('data:image/svg+xml')!= -1){ $(this).remove(); } }) $("LINK[href*='style-49037e4d27.css']").remove(); $("LINK[href*='markdown_views-d7a94ec6ab.css']").remove(); layui.use(['jquery', 'layer','code'], function(){ $("pre").attr("class","layui-code"); $("pre").attr("lay-title",""); $("pre").attr("lay-skin",""); layui.code(); $(".layui-code-h3 a").attr("class","copycode").html("復制代碼 ").attr("onclick","copycode(this)"); }); function copycode(target){ var id=$(target).parent().parent().attr("id"); var clipboard = new ClipboardJS("#"+id); clipboard.on('success', function(e) { e.clearSelection(); alert("復制成功") }); clipboard.on('error', function(e) { alert("復制失敗") }); } //$(".site-seo-depict").html($(".site-seo-depict").html().slice(0, -5)); </script> <link rel="stylesheet" type="text/css" href="http://www.ezyhdfw.cn/yun/static/js/neweditor/code/styles/tomorrow-night-eighties.css"> <script src="http://www.ezyhdfw.cn/yun/static/js/neweditor/code/highlight.pack.js" type="text/javascript"></script> <script src="http://www.ezyhdfw.cn/yun/static/js/clipboard.js"></script> <script>hljs.initHighlightingOnLoad();</script> <script> function setcode(){ var _html=''; document.querySelectorAll('pre code').forEach((block) => { var _tmptext=$.trim($(block).text()); if(_tmptext!=''){ _html=_html+_tmptext; console.log(_html); } }); } </script> <script> function payread(){ layer.open({ type: 1, title:"付費閱讀", shadeClose: true, content: $('#payread') }); } // 舉報 function jupao_tip(){ layer.open({ type: 1, title:false, shadeClose: true, content: $('#jubao') }); } $(".getcommentlist").click(function(){ var _id=$(this).attr("dataid"); var _tid=$(this).attr("datatid"); $("#articlecommentlist"+_id).toggleClass("hide"); var flag=$("#articlecommentlist"+_id).attr("dataflag"); if(flag==1){ flag=0; }else{ flag=1; //加載評論 loadarticlecommentlist(_id,_tid); } $("#articlecommentlist"+_id).attr("dataflag",flag); }) $(".add-comment-btn").click(function(){ var _id=$(this).attr("dataid"); $(".formcomment"+_id).toggleClass("hide"); }) $(".btn-sendartcomment").click(function(){ var _aid=$(this).attr("dataid"); var _tid=$(this).attr("datatid"); var _content=$.trim($(".commenttext"+_aid).val()); if(_content==''){ alert("評論內(nèi)容不能為空"); return false; } var touid=$("#btnsendcomment"+_aid).attr("touid"); if(touid==null){ touid=0; } addarticlecomment(_tid,_aid,_content,touid); }) $(".button_agree").click(function(){ var supportobj = $(this); var tid = $(this).attr("id"); $.ajax({ type: "GET", url:"http://www.ezyhdfw.cn/yun/index.php?topic/ajaxhassupport/" + tid, cache: false, success: function(hassupport){ if (hassupport != '1'){ $.ajax({ type: "GET", cache:false, url: "http://www.ezyhdfw.cn/yun/index.php?topic/ajaxaddsupport/" + tid, success: function(comments) { supportobj.find("span").html(comments+"人贊"); } }); }else{ alert("您已經(jīng)贊過"); } } }); }); function attenquestion(_tid,_rs){ $.ajax({ //提交數(shù)據(jù)的類型 POST GET type:"POST", //提交的網(wǎng)址 url:"http://www.ezyhdfw.cn/yun/favorite/topicadd.html", //提交的數(shù)據(jù) data:{tid:_tid,rs:_rs}, //返回數(shù)據(jù)的格式 datatype: "json",//"xml", "html", "script", "json", "jsonp", "text". //在請求之前調(diào)用的函數(shù) beforeSend:function(){}, //成功返回之后調(diào)用的函數(shù) success:function(data){ var data=eval("("+data+")"); console.log(data) if(data.code==2000){ layer.msg(data.msg,function(){ if(data.rs==1){ //取消收藏 $(".layui-layer-tips").attr("data-tips","收藏文章"); $(".layui-layer-tips").html('<i class="fa fa-heart-o"></i>'); } if(data.rs==0){ //收藏成功 $(".layui-layer-tips").attr("data-tips","已收藏文章"); $(".layui-layer-tips").html('<i class="fa fa-heart"></i>') } }) }else{ layer.msg(data.msg) } } , //調(diào)用執(zhí)行后調(diào)用的函數(shù) complete: function(XMLHttpRequest, textStatus){ postadopt=true; }, //調(diào)用出錯執(zhí)行的函數(shù) error: function(){ //請求出錯處理 postadopt=false; } }); } </script> <footer> <div id="dnkpnhlp" class="layui-container"> <div id="dnkpnhlp" class="flex_box_zd"> <div id="dnkpnhlp" class="left-footer"> <h6><a href="http://www.ezyhdfw.cn/"><img src="http://www.ezyhdfw.cn/yun/static/theme/ukd//images/logo.png" alt="UCloud (優(yōu)刻得科技股份有限公司)"></a></h6> <p>UCloud (優(yōu)刻得科技股份有限公司)是中立、安全的云計算服務平臺,堅持中立,不涉足客戶業(yè)務領(lǐng)域。公司自主研發(fā)IaaS、PaaS、大數(shù)據(jù)流通平臺、AI服務平臺等一系列云計算產(chǎn)品,并深入了解互聯(lián)網(wǎng)、傳統(tǒng)企業(yè)在不同場景下的業(yè)務需求,提供公有云、混合云、私有云、專有云在內(nèi)的綜合性行業(yè)解決方案。</p> </div> <div id="dnkpnhlp" class="right-footer layui-hidemd"> <ul class="flex_box_zd"> <li> <h6>UCloud與云服務</h6> <p><a href="http://www.ezyhdfw.cn/site/about/intro/">公司介紹</a></p> <p><a >加入我們</a></p> <p><a href="http://www.ezyhdfw.cn/site/ucan/onlineclass/">UCan線上公開課</a></p> <p><a href="http://www.ezyhdfw.cn/site/solutions.html" >行業(yè)解決方案</a></p> <p><a href="http://www.ezyhdfw.cn/site/pro-notice/">產(chǎn)品動態(tài)</a></p> </li> <li> <h6>友情鏈接</h6> <p><a >GPU算力平臺</a></p> <p><a >UCloud私有云</a></p> <p><a >SurferCloud</a></p> <p><a >工廠仿真軟件</a></p> <p><a >AI繪畫</a></p> <p><a >Wavespeed AI</a></p> </li> <li> <h6>社區(qū)欄目</h6> <p><a href="http://www.ezyhdfw.cn/yun/column/index.html">專欄文章</a></p> <p><a href="http://www.ezyhdfw.cn/yun/udata/">專題地圖</a></p> </li> <li> <h6>常見問題</h6> <p><a href="http://www.ezyhdfw.cn/site/ucsafe/notice.html" >安全中心</a></p> <p><a href="http://www.ezyhdfw.cn/site/about/news/recent/" >新聞動態(tài)</a></p> <p><a href="http://www.ezyhdfw.cn/site/about/news/report/">媒體動態(tài)</a></p> <p><a href="http://www.ezyhdfw.cn/site/cases.html">客戶案例</a></p> <p><a href="http://www.ezyhdfw.cn/site/notice/">公告</a></p> </li> <li> <span><img src="https://static.ucloud.cn/7a4b6983f4b94bcb97380adc5d073865.png" alt="優(yōu)刻得"></span> <p>掃掃了解更多</p></div> </div> <div id="dnkpnhlp" class="copyright">Copyright ? 2012-2025 UCloud 優(yōu)刻得科技股份有限公司<i>|</i><a rel="nofollow" >滬公網(wǎng)安備 31011002000058號</a><i>|</i><a rel="nofollow" ></a> 滬ICP備12020087號-3</a><i>|</i> <script type="text/javascript" src="https://gyfk12.kuaishang.cn/bs/ks.j?cI=197688&fI=125915" charset="utf-8"></script> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://#/hm.js?290c2650b305fc9fff0dbdcafe48b59d"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-DZSMXQ3P9N"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-DZSMXQ3P9N'); </script> <script> (function(){ var el = document.createElement("script"); el.src = "https://lf1-cdn-tos.bytegoofy.com/goofy/ttzz/push.js?99f50ea166557aed914eb4a66a7a70a4709cbb98a54ecb576877d99556fb4bfc3d72cd14f8a76432df3935ab77ec54f830517b3cb210f7fd334f50ccb772134a"; el.id = "ttzz"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(el, s); })(window) </script></div> </div> </footer> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.ezyhdfw.cn/" title="亚洲中字慕日产2020,大陆极品少妇内射AAAAAA,无码av大香线蕉伊人久久,久久精品国产亚洲av麻豆网站 ">亚洲中字慕日产2020,大陆极品少妇内射AAAAAA,无码av大香线蕉伊人久久,久久精品国产亚洲av麻豆网站 </a> <div class="friend-links"> </div> </div> </footer> <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body><div id="icuea" class="pl_css_ganrao" style="display: none;"><sup id="icuea"><center id="icuea"><dl id="icuea"></dl></center></sup><center id="icuea"></center><dd id="icuea"></dd><sup id="icuea"></sup><kbd id="icuea"><center id="icuea"><dd id="icuea"></dd></center></kbd><optgroup id="icuea"><abbr id="icuea"><pre id="icuea"></pre></abbr></optgroup><td id="icuea"></td><dd id="icuea"><th id="icuea"><menu id="icuea"></menu></th></dd><noscript id="icuea"><option id="icuea"><delect id="icuea"></delect></option></noscript><th id="icuea"><s id="icuea"><bdo id="icuea"></bdo></s></th><tfoot id="icuea"></tfoot><tbody id="icuea"><button id="icuea"><samp id="icuea"></samp></button></tbody><wbr id="icuea"><cite id="icuea"><nav id="icuea"></nav></cite></wbr><tr id="icuea"></tr><tfoot id="icuea"></tfoot><strike id="icuea"></strike><center id="icuea"><dd id="icuea"><th id="icuea"></th></dd></center><pre id="icuea"><dd id="icuea"><th id="icuea"></th></dd></pre><pre id="icuea"></pre><button id="icuea"><samp id="icuea"><tbody id="icuea"></tbody></samp></button><sup id="icuea"></sup><samp id="icuea"><tbody id="icuea"><source id="icuea"></source></tbody></samp><strike id="icuea"></strike><th id="icuea"><menu id="icuea"><noscript id="icuea"></noscript></menu></th><wbr id="icuea"></wbr><td id="icuea"></td><center id="icuea"></center><option id="icuea"><del id="icuea"><dfn id="icuea"></dfn></del></option><optgroup id="icuea"><tbody id="icuea"><button id="icuea"></button></tbody></optgroup><acronym id="icuea"><xmp id="icuea"><strike id="icuea"></strike></xmp></acronym><input id="icuea"></input><nav id="icuea"></nav><tbody id="icuea"></tbody><tr id="icuea"><button id="icuea"><ul id="icuea"></ul></button></tr><blockquote id="icuea"></blockquote><xmp id="icuea"></xmp><tbody id="icuea"></tbody><tr id="icuea"><pre id="icuea"><ul id="icuea"></ul></pre></tr><button id="icuea"></button><blockquote id="icuea"><em id="icuea"><small id="icuea"></small></em></blockquote><tr id="icuea"></tr><tbody id="icuea"></tbody><center id="icuea"></center><center id="icuea"><dd id="icuea"><th id="icuea"></th></dd></center><samp id="icuea"></samp><rt id="icuea"></rt><strong id="icuea"></strong><button id="icuea"></button><rt id="icuea"></rt><tr id="icuea"></tr></div> <script src="http://www.ezyhdfw.cn/yun/static/theme/ukd/js/common.js"></script> <<script type="text/javascript"> $(".site-seo-depict *,.site-content-answer-body *,.site-body-depict *").css("max-width","100%"); </script> </html>