Advertisement
Guest User

Untitled

a guest
Jun 21st, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  new Vue({
  2.         el: "#app",
  3.         data: {
  4.             items: [
  5.                 "Sok",
  6.                 "Mleko",
  7.                 "Chleb",
  8.                 "Szampan"
  9.             ]
  10.         },
  11.         methods: {
  12.             addItem: function() {
  13.                 this.items.push( prompt("Podaj produkt") );
  14.             },
  15.             filterItems: function() {
  16.                 this.items = this.items.filter(function(item) {
  17.                     return item.charAt(0) === "S";
  18.                 });
  19.             }
  20.         }
  21.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement