Created
May 2, 2022 17:07
-
-
Save JeffreyWay/3ce3c6470adf6a1bf599a772e6a6b59b to your computer and use it in GitHub Desktop.
Learn Vue 3, Step by Step - Episode 6, Component Props
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
import AppButton from "./AppButton.js"; | |
export default { | |
components: { | |
'app-button': AppButton | |
} | |
}; |
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
<!doctype html> | |
<html lang="en" class="h-full"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Episode 5: Extract Components to Their Own Files</title> | |
<script src="https://unpkg.com/vue@3"></script> | |
<script src="https://cdn.tailwindcss.com"></script> | |
<style> | |
@keyframes spinner { | |
to {transform: rotate(360deg);} | |
} | |
.is-loading { color: transparent; } | |
.is-loading:before { | |
content: ''; | |
box-sizing: border-box; | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
width: 20px; | |
height: 20px; | |
margin-top: -10px; | |
margin-left: -10px; | |
border-radius: 50%; | |
border: 2px solid #ccc; | |
border-top-color: #000; | |
animation: spinner .6s linear infinite; | |
} | |
</style> | |
</head> | |
<body class="h-full grid place-items-center"> | |
<div id="app"> | |
<app-button :processing="true">Submit</app-button> | |
</div> | |
<script type="module"> | |
import App from "./js/components/App.js"; | |
Vue.createApp(App).mount('#app'); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment