Advertisement
loloof64

Udemy VueJS course - assignement 4 - html

Oct 1st, 2020
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.43 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.   <head>
  4.     <meta charset="UTF-8" />
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6.     <title>Vue Basics</title>
  7.     <link
  8.      href="https://fonts.googleapis.com/css2?family=Jost:wght@400;700&display=swap"
  9.      rel="stylesheet"
  10.    />
  11.     <link rel="stylesheet" href="styles.css" />
  12.     <script src="https://unpkg.com/vue@next" defer></script>
  13.     <script src="app.js" defer></script>
  14.   </head>
  15.   <body>
  16.     <header>
  17.       <h1>Vue Styling</h1>
  18.     </header>
  19.     <section id="assignment">
  20.       <!-- 1) Fetch the user input and use it as a CSS class -->
  21.       <!-- The entered class should be added to the below paragraph -->
  22.       <input type="text" v-model="userSelectedClass"/>
  23.       <!-- (available classes: "user1", "user2") -->
  24.       <p :class="[userSelectedClass, paragraphVisibilityClass]">
  25.         Style me!
  26.       </p>
  27.       <button @click="toggleParagraphVisibility">Toggle Paragraph</button>
  28.       <!-- 2) Use the "visible" and "hidden" classes to show/ hide the above paragraph -->
  29.       <!-- Clicking the button should toggle between the two options -->
  30.  
  31.       <!-- 3) Add dynamic inline styling to the below paragraph and let the user enter a background-color -->
  32.       <input type="text" v-model="userSelectedBackgroundColor" />
  33.       <p :style="{backgroundColor: userSelectedBackgroundColor}">Style me inline!</p>
  34.     </section>
  35.   </body>
  36. </html>
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement