Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export default {
- name: 'IngMenu',
- props:['ingredients'],
- data () {
- return {
- selected: '',
- }
- },
- render: function(createElement){
- return createElement('select',
- this.$props.ingredients.map(function(ing){
- return createElement('option', ing.name)
- })
- )
- }
- }
- <button class="btn" id="add" v-on:click="addRow">Add Ingredient</button>
- methods: {
- addRow: function(){
- let table = document.getElementById("tab");
- let row = table.insertRow();
- let cell1 = row.insertCell(0);
- let cell2 = row.insertCell(1);
- let cell3 = row.insertCell(2);
- let cell4 = row.insertCell(3);
- let cell5 = row.insertCell(4);
- cell1.appendChild(document.createElement('Ingmenu')); //ERROR
- cell2.innerHTML = "NEW CELL2";
- cell3.innerHTML = "NEW CELL2";
- cell4.innerHTML = "NEW CELL2";
- cell5.innerHTML = "NEW CELL2";
- }
Add Comment
Please, Sign In to add comment