好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

snabbdom

snabbdom 介绍

虚拟DOM很棒。它允许我们将应用程序的视图表示为状态的 函数 。但是现有的 解决方 案太过膨胀,太慢,缺少 功能 ,API偏向OOP和/或缺少我需要的 功能 。?

介绍

Snabbdom由 一个 非常简单,高 性能 和可扩展的内核组成,仅约200 SLOC。它提供了具有丰富 功能 的模块化体系结构,可以通过 自定义 模块进行扩展。为了使核心保持简单,所有非必要 功能 都委托给模块。

您可以将Snabbdom塑造成您想要的任何东西!选择,选择和定制所需的 功能 。或者,您可以只使用 默 认扩展名,并获得具有高 性能 ,小尺寸和下面列出的所有 功能 的虚拟DOM库。

特征

核心 功能 大约200个SLOC –您可以轻松阅读整个核心,并完全了解它的工作原理。通过模块可扩展。每个vnode以及模块的全局可用的丰富钩子集可以钩入diff和patch过程的任何部分。出色的表现。Snabbdom是Virtual DOM Benchmark中最快的虚拟DOM库之一。具有等效于缩小/扫描 功能 的 功能 签名的修补 功能 。可以更轻松地与FRP库集成。模块中的 功能 h 用于轻松创建虚拟DOM节点的 功能 。SVG 只能与h助手一起使用。用于执行复杂css动画的 功能 。强大的事件监听器 功能 。Thunk进一步优化了差异和补丁过程。第三方 功能 借助snabbdom-pragma来 支持 jsX?。snabbdom-to-html提供的服务器端html 输出 。使用snabbdom-helpers进行紧凑的虚拟DOM创建。使用snabby 支持 模板字符串。具有虚拟外观的虚拟DOM断言

实例

var snabbdom = require('snabbdom');var patch = snabbdom.init([ // Init patch function with chosen modulesrequire('snabbdom/modules/class').default,// makes it easy to toggle classesrequire('snabbdom/modules/props').default,// for setting properties on DOM elementsrequire('snabbdom/modules/style').default,// handles styling on elements with support for animationsrequire('snabbdom/modules/eventlisteners').default,// attaches event listeners]);var h = require('snabbdom/h').default; // helper function for creating vnodesvar container = document.getElementById('container');var vnode = h('div#container.two.classes',{on: {click: someFn}},[h('span',{style: {fontWeight: 'bold'}},'This is bold'),' and this is just nor mal text',h('a',{props: {href: '/foo'}},'I'll take you places!')]);// Patch into empty DOM element – this modifies the DOM as a side effectpatch(container,vnode);var newVnode = h('div#container.two.classes',{on: {click: anotherEventHandler}},{style: {fontWeight: ' nor mal',fontStyle: 'italic'}},'This is Now italic type'),' and this is still just nor mal text',{props: {href: '/bar'}},'I'll take you places!')]);// Second `patch` invocationpatch(vnode,newVnode); // Snabbdom efficiently updates the old view to the new state// to unmount from the DOM and clean up,simply pass nullpatch(newVnode,null) 链接 : http://www.fly63.com/nav/2798

GitHub: https://github.com/snabbdom/snabbdom

网站描述: 一个 虚拟的DOM库专注于简化,模块化拥有强大的 功能 和 性能

snabbdom官方网站

官方网站:

如果觉得 网站内容还不错,欢迎将 网站 推荐给程序员好友。

查看更多关于snabbdom的详细内容...

  阅读:31次

上一篇

下一篇

第1节:thinkPHP    第2节:johnny-five    第3节:Yii    第4节:WePY    第5节:ShareDB    第6节:RxJS    第7节:d3-dag    第8节:egg-react-ssr    第9节:Deep playground    第10节:Guess.js    第11节:hyperapp    第12节:Avalon.js    第13节:Inferno    第14节:HTTPie    第15节:ITPUB    第16节:dva    第17节:Quasar    第18节:graphql-yoga    第19节:Next.js    第20节:IronJS    第21节:mpvue    第22节:react    第23节:marked.js    第24节:SAPUI5    第25节:Neuro.js    第26节:enyo.js    第27节:wire.js    第28节:ui-router    第29节:vuera    第30节:tether    第31节:Mootools    第32节:graphql.js    第33节:flex.css    第34节:bacon.js    第35节:react-move    第36节:Mithril.js    第37节:Sugar.js    第38节:tabris.js    第39节:snabbdom    第40节:vuesion    第41节:anujs    第42节:Nautil    第43节:rax    第44节:Stencil.js    第45节:dio    第46节:compromise    第47节:crypto.js    第48节:imba    第49节:alt.js    第50节:svelte    第51节:react-sortable-hoc    第52节:react-snap    第53节:Fortune.js    第54节:Qatrix    第55节:KaTeX    第56节:preactjs    第57节:Lisk    第58节:Vanilla JS    第59节:es4x    第60节:styled-components    第61节:JustAuth    第62节:html2canvas    第63节:backbone    第64节:ml.js    第65节:virtual-dom    第66节:nw.js    第67节:umbrella.js    第68节:Walt    第69节:MXFlutter    第70节:FileSaver.js    第71节:Rivets.js    第72节:way.js    第73节:Flight.js    第74节:react-static    第75节:rethinkdb    第76节:Chromeless    第77节:i18next    第78节:Choo    第79节:jsMind    第80节:knockout.js    第81节:nuxt.js    第82节:Mpx    第83节:Vue    第84节:Meteor.js    第85节:Towxml    第86节:vue-resource    第87节:DefinitelyTyped    第88节:Aurelia    第89节:jsrender    第90节:Dahlia    第91节:tfjs-core    第92节:is.js    第93节:immer.js    第94节:STDLib    第95节:angular-seed    第96节:Cube.js    第97节:SproutCore    第98节:vecty.js    第99节:Maquette    第100节:Redux    第101节:Javascript Fun    第102节:moon    第103节:Ember    第104节:react-redux    第105节:falcor    第106节:normalizr    第107节:Automerge    第108节:PapaParse    第109节:LokiJS    第110节:Megalo    第111节:Selection.js    第112节:react-router    第113节:Manta    第114节:ccxt    第115节:CloudBoost    第116节:cool-admin    第117节:Vapper    第118节:ramda    第119节:Scala.js    第120节:limejs    第121节:Senna.js    第122节:fuelux    第123节:emotion    第124节:eeui    第125节:Riot.js    第126节:HooX    第127节:linaria    第128节:Keras.js    第129节:worker-dom    第130节:vite    第131节:Mermaid    第132节:Chameleon    第133节:quicklink    第134节:lovli.js    第135节:localForage    第136节:Cycle.js    第137节:Konva.js    第138节:ConvNetJS    第139节:IPFS    第140节:angular-dart    第141节:DojotoolKit    第142节:InversifyJS    第143节:cash    第144节:react-motion    第145节:hox    第146节:KISSY    第147节:mind.js    第148节:Leaflet.js    第149节:Omi    第150节:vue-router    第151节:graphql-js    第152节:vue-rx    第153节:asm-dom    第154节:weui.js    第155节:react-server    第156节:togetherjs    第157节:Duktape    第158节:Zebkit    第159节:MontageJS    第160节:Underscore.js    第161节:CanJS    第162节:Tesseract.js    第163节:sheetjs    第164节:Rocket    第165节:construct-js    第166节:rrweb    第167节:Neataptic    第168节:Flux    第169节:aframe    第170节:ThingJS    第171节:Midway    第172节:webdnn    第173节:Brain.js    第174节:UmiJs(五米)    第175节:reactxp    第176节:TensorFlow.js    第177节:Kbone    第178节:relay    第179节:H-ui    第180节:AngularJS    第181节:after.js    第182节:Dojo    第183节:jsoneditor    第184节:react-360    第185节:truffle    第186节:ale.js    第187节:pico.js    第188节:PathFinding.js    第189节:NodeList.js    第190节:interact.js    第191节:Immutable.js    第192节:cell    第193节:QuoJS    第194节:zepto.js    第195节:flutter-desktop-embedding    第196节:fre.js    第197节:Razzle    第198节:ocLazyLoad    第199节:eventproxy    第200节:vuex    第201节:angularfire2    第202节:socket.io    第203节:SkateJS    第204节:polymer    第205节:Electron    第206节:Nerv    第207节:Mind elixir    第208节:PeerJS    第209节:React Router    第210节:joi    第211节:single-spa    第212节:workbox    第213节:san    第214节:apify-js    第215节:Bootstrap    第216节:Angular    第217节:QucikUI    第218节:Expressjs    第219节:ThinkJS    第220节:Nest JS    第221节:Laravel    第222节:CodeIgniter    第223节:Zend Framework    第224节:CakePHP    第225节:Symfony    第226节:StartMVC