1
0
mirror of synced 2025-12-08 22:58:46 +08:00

Dev: Plugin initialization

This commit is contained in:
surunzi
2017-01-02 12:09:37 +08:00
parent b224c116fb
commit 6a8894e6fe
4 changed files with 32 additions and 4 deletions

View File

@@ -15,6 +15,9 @@
<li>
<a href="#" id="issue17">#17</a>
</li>
<li>
<a href="#" id="plugin">Plugin</a>
</li>
</ul>
</nav>
<script>
@@ -37,6 +40,22 @@
var a = new A();
console.log(a);
});
addClickEvent('plugin', function ()
{
eruda.add({name: 'test'});
eruda.add(function (eruda)
{
console.log(eruda);
return {
name: 'test2',
init: function ($el)
{
this._$el = $el;
this._$el.html('This is the new plugin');
}
};
});
});
</script>
<script>boot();</script>
</body>