Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Hello Vue</title>
- <meta charset="utf-8">
- <!-- https://unpkg.com/vue@2.6.11/dist/vue.min.js -->
- <!-- подключение фреймворка vue.js -->
- <script type="text/javascript" src="https://unpkg.com/vue"></script>
- <style type="text/css">
- body {
- background: #20262E;
- padding: 20px;
- font-family: Helvetica;
- }
- #app {
- background: #fff;
- border-radius: 4px;
- padding: 20px;
- transition: all 0.2s;
- }
- li {
- margin: 8px 0;
- }
- h2 {
- font-weight: bold;
- margin-bottom: 15px;
- }
- del {
- color: rgba(0, 0, 0, 0.3);
- }
- </style>
- </head>
- <body>
- <!-- элемент div c идентификатором app -->
- <!-- v-for -->
- <div id="app">
- <a :href="hrefValue">{{linkName}}</a>
- <a v-bind:href="hrefValue">{{linkName}}</a>
- <img :src="srcValue">
- </div>
- </body>
- <script type="text/javascript">
- // создаем объект Vue (экземпляр Vue)
- new Vue({
- el: "#app",
- data: {
- hrefValue: 'https://google.ru',
- linkName: 'Ссылка asfasasfas',
- srcValue: 'https://via.placeholder.com/350x150',
- todos: [
- { text: "Learn JavaScript", done: false },
- { text: "Learn Vue", done: false },
- { text: "Play around in JSFiddle", done: true },
- { text: "Build something awesome", done: true }
- ]
- },
- methods: {
- toggle: function(todo){
- todo.done = !todo.done
- }
- }
- })
- </script>
- </html>
Add Comment
Please, Sign In to add comment