【文件属性】:
文件名称:showable:Mixin 视图使它们显示和隐藏
文件大小:32KB
文件格式:ZIP
更新时间:2021-07-02 20:46:54
JavaScript
可显示的
Mixin 视图添加show和hide方法。 用于需要显示和隐藏但也需要考虑转换的对话框和叠加层之类的东西。
在视图上切换.hide类。
应用程序接口
var showable = require ( 'showable' ) ;
showable ( MyView . prototype ) ;
然后你可能会监听事件以从 DOM 中添加和删除它:
function MyView ( ) {
this . on ( 'showing' , function ( ) {
document . body . appendChild ( obj . el ) ;
} ) ;
this . on ( 'hide' , function ( ) {
document . body . removeChild ( obj . el ) ;
} ) ;
【文件预览】:
showable-master
----.gitignore(16B)
----Makefile(218B)
----index.js(1KB)
----README.md(964B)
----component.json(302B)
----test()
--------index.html(548B)
--------mocha.css(4KB)
--------mocha.js(120KB)
--------tests.js(2KB)