sergAccount

Untitled

Sep 28th, 2020
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.45 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title>Hello Vue</title>
  5.     <meta charset="utf-8">
  6.     <!-- https://unpkg.com/vue@2.6.11/dist/vue.min.js -->
  7.     <!-- подключение фреймворка vue.js -->
  8.     <script type="text/javascript" src="https://unpkg.com/vue"></script>
  9.     <style type="text/css">
  10.         body {
  11.   background: #20262E;
  12.   padding: 20px;
  13.   font-family: Helvetica;
  14. }
  15.  
  16. #app {
  17.   background: #fff;
  18.   border-radius: 4px;
  19.   padding: 20px;
  20.   transition: all 0.2s;
  21. }
  22.  
  23. li {
  24.   margin: 8px 0;
  25. }
  26.  
  27. h2 {
  28.   font-weight: bold;
  29.   margin-bottom: 15px;
  30. }
  31.  
  32. del {
  33.   color: rgba(0, 0, 0, 0.3);
  34. }
  35.     </style>
  36. </head>
  37. <body>
  38. <!-- элемент div c идентификатором app -->
  39.  
  40. <!-- v-for -->
  41. <div id="app"> 
  42.   <a :href="hrefValue">{{linkName}}</a>
  43.   <a v-bind:href="hrefValue">{{linkName}}</a>
  44.   <img :src="srcValue">
  45. </div>
  46. </body>
  47. <script type="text/javascript">
  48.     // создаем объект Vue (экземпляр Vue)
  49.     new Vue({
  50.   el: "#app",
  51.   data: {
  52.     hrefValue: 'https://google.ru',
  53.     linkName: 'Ссылка asfasasfas',
  54.     srcValue: 'https://via.placeholder.com/350x150',
  55.     todos: [
  56.       { text: "Learn JavaScript", done: false },
  57.       { text: "Learn Vue", done: false },
  58.       { text: "Play around in JSFiddle", done: true },
  59.       { text: "Build something awesome", done: true }
  60.     ]
  61.   },
  62.   methods: {
  63.     toggle: function(todo){
  64.         todo.done = !todo.done
  65.     }
  66.   }
  67. })
  68. </script>
  69. </html>
Add Comment
Please, Sign In to add comment