For javascript code linked to your component, use @script tag that will render it in a code block, just below the markup.
/**
* Header bar with logo, navigation, and tool icons at the top of the page.
*
* @structure Header
* @flag full-width
* @markup
* <div class="SG-header">
* @{include:.SG-logo}
* @{include:.SG-nav-icons}
* @{include:.SG-nav}
* </div>
* @script
* $('body').on('click', '.SG-header', function () {
* $(this).doSomething();
* });
*/
.SG-header{
...
}