I have a function that creates buttons for each item in a list, and each button is supposed to execute a function in the App.vue file when clicked.
The issue I am facing is that neither the onclick
nor the v-on:click
methods are functioning as expected.
Here is the code snippet:
await resetView();
// document.getElementById("projSelLb").style.display = "none";
var projects = await detaStorage.getAllProjects();
var parentDiv = document.getElementById('projectsDetaDiv');
projects.forEach(function(item) {
var div = document.createElement('div');
div.innerHTML = `<button type="button" class="btn btn-primary" style="margin-top: 12px;" @click.native="loadFromDeta(String(item))">${item}</button>`;
parentDiv.appendChild(div);
});
// document.getElementById("projSelLb").style.display = "block";
document.getElementById("spinnerGetProj").style.display = "none";
async function resetView() {
// document.getElementById("projSelLb").style.display = "none";
document.getElementById("spinnerGetProj").style.display = "block";
document.getElementById('projectsDetaDiv').innerHTML = null;
}
function loadFromDeta(name) {
workspaceClear();
var data = detaStorage.getProjectData();
Blockly.Xml.domToWorkspace(data.xml, foo.value.workspace);
}