Skip to content

Commit

Permalink
Update: Test with Svelte 5
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed Nov 13, 2024
1 parent 290a241 commit 6b9f303
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Test/Resources/Private/Svelte.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { mount } from 'svelte'
import App from "./Svelte.svelte";

new App({
target: document.body,
mount(App, {
target: document.getElementById('app'),
});
14 changes: 11 additions & 3 deletions Test/Resources/Private/Svelte.svelte
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
<script>
let name = 'Carbon.Pipeline';
import './_Svelte.css';
let name = $state('Carbon.Pipeline');
let count = $state(0);
function increment() {
count ++;
}
</script>

<div class="container">
<input type="text" bind:value={name}>
<h1>Hello {name}!</h1>
<h2>Hello {name}!</h2>
<button onclick={increment}>
count is {count}
</button>
</div>

<style>
h1 {
color:green;
}
:global(h2) {
:global(button) {
color:red;
}
</style>

0 comments on commit 6b9f303

Please sign in to comment.