This repository has been archived on 2021-09-06. You can view files and clone it, but cannot push or open issues or pull requests.
vuejs_course/2021-01-18 basics-assignmen.../index.html

37 lines
1.3 KiB
HTML
Raw Normal View History

2021-01-18 22:55:50 +01:00
<!DOCTYPE html>
<html lang="en">
2021-01-18 23:22:34 +01:00
<head>
2021-01-18 22:55:50 +01:00
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vue Basics</title>
2021-01-18 23:22:34 +01:00
<link href="https://fonts.googleapis.com/css2?family=Jost:wght@400;700&display=swap" rel="stylesheet" />
2021-01-18 22:55:50 +01:00
<link rel="stylesheet" href="styles.css" />
<script src="https://unpkg.com/vue@next" defer></script>
<script src="app.js" defer></script>
2021-01-18 23:22:34 +01:00
</head>
<body>
2021-01-18 22:55:50 +01:00
<header>
2021-01-18 23:22:34 +01:00
<h1>Vue Styling</h1>
2021-01-18 22:55:50 +01:00
</header>
<section id="assignment">
2021-01-18 23:22:34 +01:00
<!-- 1) Fetch the user input and use it as a CSS class -->
<!-- The entered class should be added to the below paragraph -->
2021-01-18 23:34:24 +01:00
<input type="text" v-model="inputClass" />
2021-01-18 23:22:34 +01:00
<!-- (available classes: "user1", "user2") -->
<p :class="classFromUserInput">
Style me!
</p>
<button @click="toggleParagraphVisibility">Toggle Paragraph</button>
<!-- 2) Use the "visible" and "hidden" classes to show/ hide the above paragraph -->
<!-- Clicking the button should toggle between the two options -->
2021-01-18 22:55:50 +01:00
2021-01-18 23:22:34 +01:00
<!-- 3) Add dynamic inline styling to the below paragraph and let the user enter a background-color -->
2021-01-18 23:34:24 +01:00
<input type="text" v-model="inputColor" />
2021-01-18 23:22:34 +01:00
<p :style="{backgroundColor: inputColor}">Style me inline!</p>
2021-01-18 22:55:50 +01:00
</section>
2021-01-18 23:22:34 +01:00
</body>
2021-01-18 22:55:50 +01:00
</html>