Cleanup uid once module destroyed + destroy parent class + added example
This commit is contained in:
@@ -1 +1,2 @@
|
|||||||
/* jshint esnext: true */
|
/* jshint esnext: true */
|
||||||
|
export {default as Example} from './modules/Example';
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export default class
|
|||||||
destroy()
|
destroy()
|
||||||
{
|
{
|
||||||
if (this.$el) {
|
if (this.$el) {
|
||||||
this.$el.off();
|
this.$el.removeData('uid')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
21
assets/scripts/modules/Example.js
Normal file
21
assets/scripts/modules/Example.js
Normal 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
@@ -17,7 +17,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div id="js-barba-wrapper">
|
<div id="js-barba-wrapper">
|
||||||
<div class="js-barba-container" data-template="home">
|
<div class="js-barba-container" data-template="home">
|
||||||
|
<div data-module="Example"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user