const {t} = ef

const MyComponent = class extends t`
>button
  @click = emitCustomEvent
  .Click me!
` {
  constructor(...args) {
    super(...args)
    this.$methods.emitCustomEvent = ({state}) => {
      state.$emit('myCustomEvent')
    }
  }
}

const App = t`
>MyComponent
  @myCustomEvent = handleCustomEvent
`

const app = new App({
  $methods: {
    handleCustomEvent() {
      alert('Custom event triggered!')
    }
  }
}, {MyComponent})

app.$mount({target: document.body})

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://unpkg.com/ef.js