Advertisement
loloof64

VueJSUdemyCourse-ListAssign 1-Js

Oct 1st, 2020
2,194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const app = Vue.createApp({
  2.     data() {
  3.         return {
  4.             currentTask: '',
  5.             tasks: [],
  6.             listVisible: true,
  7.         };
  8.     },
  9.     methods: {
  10.         addTask() {
  11.             this.tasks.push(this.currentTask);
  12.         },
  13.         toggleListVisibility() {
  14.             this.listVisible = ! this.listVisible;
  15.         }
  16.     },
  17.     computed: {
  18.         buttonCaption() {
  19.             return this.listVisible ? 'Hide' : 'Show';
  20.         }
  21.     }
  22. });
  23.  
  24. app.mount('#assignment');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement