Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vue.component("Welcome", {
- data: function() {
- return {
- message: "Hello Component!"
- };
- },
- template: '<div id="myApp">{{ message }}</div>'
- });
- new Vue({
- el: "#myApp",
- components: {
- welcome: "Welcome"
- },
- data: {
- message: "Hello world!",
- display: true
- },
- computed: {
- getMessage() {
- return this.message;
- }
- },
- watch: {
- message: function(val) {
- console.log("message changed", val);
- }
- },
- methods: {
- updateMessage() {
- this.message = "Wassup World";
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement