Guest User

Untitled

a guest
Jan 23rd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. export default {
  2. name: 'IngMenu',
  3. props:['ingredients'],
  4. data () {
  5. return {
  6. selected: '',
  7. }
  8. },
  9. render: function(createElement){
  10. return createElement('select',
  11. this.$props.ingredients.map(function(ing){
  12. return createElement('option', ing.name)
  13. })
  14. )
  15.  
  16. }
  17. }
  18.  
  19. <button class="btn" id="add" v-on:click="addRow">Add Ingredient</button>
  20.  
  21. methods: {
  22. addRow: function(){
  23. let table = document.getElementById("tab");
  24. let row = table.insertRow();
  25. let cell1 = row.insertCell(0);
  26. let cell2 = row.insertCell(1);
  27. let cell3 = row.insertCell(2);
  28. let cell4 = row.insertCell(3);
  29. let cell5 = row.insertCell(4);
  30. cell1.appendChild(document.createElement('Ingmenu')); //ERROR
  31. cell2.innerHTML = "NEW CELL2";
  32. cell3.innerHTML = "NEW CELL2";
  33. cell4.innerHTML = "NEW CELL2";
  34. cell5.innerHTML = "NEW CELL2";
  35.  
  36. }
Add Comment
Please, Sign In to add comment