Cleanup uid once module destroyed + destroy parent class + added example

This commit is contained in:
Dominic Lord
2017-04-06 14:04:29 -04:00
parent af01ff20ee
commit 8b9ee3d0ec
5 changed files with 121 additions and 18 deletions

View File

@@ -1 +1,2 @@
/* jshint esnext: true */
export {default as Example} from './modules/Example';

View File

@@ -22,7 +22,7 @@ export default class
destroy()
{
if (this.$el) {
this.$el.off();
this.$el.removeData('uid')
}
}
}

View File

@@ -0,0 +1,21 @@
/* jshint esnext: true */
import AbstractModule from './AbstractModule';
export default class extends AbstractModule
{
constructor(options)
{
super(options);
// Declaration of properties
}
init() {
// Set events and such
}
destroy()
{
super.destroy();
}
}

File diff suppressed because one or more lines are too long

View File

@@ -17,7 +17,7 @@
<body>
<div id="js-barba-wrapper">
<div class="js-barba-container" data-template="home">
<div data-module="Example"></div>
</div>
</div>