diff --git a/app/javascript/entrypoints/ui.js b/app/javascript/entrypoints/ui.js index a17e3593f..81a2468e7 100644 --- a/app/javascript/entrypoints/ui.js +++ b/app/javascript/entrypoints/ui.js @@ -1,3 +1,28 @@ -export function greet() { - return 'Hello'; -} +import { h, createCustomElement } from 'vue'; + +const ChatButton = { + name: 'ChatButton', + props: { + label: { + type: String, + default: 'Click me', + }, + }, + render() { + return h( + 'button', + { + class: 'cha-button', + onClick: this.handleClick, + }, + this.label + ); + }, + methods: { + handleClick() { + // console.log('Button clicked'); + }, + }, +}; + +export const buttonElement = createCustomElement(ChatButton);