pdaeks

Untitled

Jul 22nd, 2021
959
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <meta charset="utf-8">
  5.     <title>Показываю пример работы с vuejs</title>
  6.  
  7.     <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
  8. </head>
  9. <body>
  10. <div id="my_app">
  11. <input type="text" v-model="enterText"></input>
  12. {{enterText}}
  13. <hr />
  14. <button @click="changeText">Изменить текст</button><br />
  15.     {{message }}
  16. </div>
  17. </body>
  18. <script type="text/javascript">
  19. var app = new Vue({
  20.   el: '#my_app',
  21.   data: {
  22.     message: 'Привет, Vue!',
  23.     enterText: null
  24.   },
  25.   methods:{
  26.     changeText(){
  27.         this.message = 'Пока, Vue!'
  28.     }
  29.   }
  30. })
  31. </script>
  32. </html>
RAW Paste Data