Advertisement
Guest User

Untitled

a guest
Aug 25th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. Vue.component("Welcome", {
  2. data: function() {
  3. return {
  4. message: "Hello Component!"
  5. };
  6. },
  7. template: '<div id="myApp">{{ message }}</div>'
  8. });
  9. new Vue({
  10. el: "#myApp",
  11. components: {
  12. welcome: "Welcome"
  13. },
  14. data: {
  15. message: "Hello world!",
  16. display: true
  17. },
  18. computed: {
  19. getMessage() {
  20. return this.message;
  21. }
  22. },
  23. watch: {
  24. message: function(val) {
  25. console.log("message changed", val);
  26. }
  27. },
  28. methods: {
  29. updateMessage() {
  30. this.message = "Wassup World";
  31. }
  32. }
  33. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement