j4pm/app/javascript/packs/hello_svelte.js

21 lines
558 B
JavaScript
Raw Normal View History

2021-12-10 19:39:43 +00:00
/* eslint no-console: 0 */
// Run this example by adding <%= javascript_pack_tag 'hello_svelte' %> (and
// <%= stylesheet_pack_tag 'hello_svelte' %> if you have styles in your component)
// to the head of your layout file,
// like app/views/layouts/application.html.erb.
// All it does is render <div>Hello Svelte!</div> at the bottom of the page.
import App from '../app.svelte'
document.addEventListener('DOMContentLoaded', () => {
const app = new App({
target: document.body,
props: {
name: 'Svelte'
}
});
window.app = app;
})