Created
April 16, 2024 10:39
-
-
Save Lulzx/d5a347f9ecab115d3dfe75613e9ea923 to your computer and use it in GitHub Desktop.
Untitled Project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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