Skip to content

Instantly share code, notes, and snippets.

@TorbjornHoltmon
Last active February 22, 2023 09:14
Show Gist options
  • Save TorbjornHoltmon/9fff759e639aff5d36387789b5f53b3d to your computer and use it in GitHub Desktop.
Save TorbjornHoltmon/9fff759e639aff5d36387789b5f53b3d to your computer and use it in GitHub Desktop.
vue jsx test
import { defineComponent, ref, watch } from "vue";
const Wow = defineComponent({
props: {
limit: {
type: Number,
required: false,
default: 12,
},
},
emits: {
limit: (value: any) => true,
},
name: "NotAnon",
setup({ limit }, { emit }) {
const count = ref(0);
const handler = () => count.value++;
watch(count, () => {
if (count.value >= limit) {
console.log("Should emit");
emit("limit", "its Done");
}
});
console.log(limit);
return () => (
<button type="button" onClick={handler}>
Count: {count.value}
<div>Så kan du få la være</div>
</button>
);
},
});
export default Wow;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment