Skip to content

Latest commit

 

History

History
36 lines (30 loc) · 678 Bytes

action.md

File metadata and controls

36 lines (30 loc) · 678 Bytes

@action

import { component, action, view } from 'app-decorators';


@view(`
    <a href="?sidebar=show" > ||| </a>
`)

@component()
class Sidebar {
    
    /**
     * Sidebar
	 * @param {Event} event
	 * @param {object} params
     */
    @action('?sidebar={{state}}') sidebar({ event, params, search, hash }){

        console.log(
            event,        // Event
            event.target, // <a href="...
            params,       // { params: { state: 'show' } }
            params.state, // show
            search,       // { sidebar: 'show' }
            hash          // {}
        );
    }
}
<body>
    <com-sidebar></com-sidebar>
</body>