Skip to content

Commit

Permalink
Add support for .htmlx
Browse files Browse the repository at this point in the history
  • Loading branch information
Umang Galaiya committed Nov 12, 2018
1 parent 1868988 commit 3096997
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4353,6 +4353,7 @@ Svelte:
color: "#e34c26"
extensions:
- ".svelte"
- ".htmlx"
SVG:
type: data
extensions:
Expand Down
37 changes: 37 additions & 0 deletions samples/Svelte/Form.htmlx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<form on:submit="createHandler(event)">
<div>
<label for="slinky-title">Title</label>
<input
bind:value='title'
id="slinky-title"
name="title"
type="text"
/>
</div>
<button type="submit">Add Now</button>
<button type="button" on:click="logState()">Log</button>
</form>

<script>
const defaultData = {
title: '',
}

export default {
data: () => defaultData,

methods: {
logState() {
console.log(this.get())
},

createHandler(event) {
event.preventDefault()
// parse, validate, fire, reset
const slinky = this.get()
this.fire('create', slinky)
this.set(defaultData)
}
},
}
</script>

0 comments on commit 3096997

Please sign in to comment.