Skip to content

Instantly share code, notes, and snippets.

@Lulzx
Created April 16, 2024 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lulzx/d5a347f9ecab115d3dfe75613e9ea923 to your computer and use it in GitHub Desktop.
Save Lulzx/d5a347f9ecab115d3dfe75613e9ea923 to your computer and use it in GitHub Desktop.
Untitled Project
<script setup lang="tsx">
import { ref } from 'vue';
const name = 'Vue';
const count = ref(0);
const align = 'center';
// define inline component
function Greeting(props: {name: string}) {
return <h1>Hello, { props.name }!</h1>
}
</script>
<template>
<div class="container">
<Greeting :name="name" />
<img class="logo" alt="logo" src="https://livecodes.io/livecodes/assets/templates/vue.svg" />
<p>You clicked {{ count }} times.</p>
<button @click="count++">Click me</button>
</div>
</template>
<style scoped>
.container,
.container button {
text-align: v-bind("align");
font: 1em sans-serif;
}
.logo {
width: 150px;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment