0👍
It show, on you current HTMLDOM
there was no function defined as onClick
. You have to define a function named onClick
and its functionality first.
for vue:
you have to define the function inside vue instance methods.
Define target:
axios
.get(apiUrl)
.then(response => {
this.$swal.fire({
target: document.getElementById('app'),
html: response.data.data.schools
.map(item => `<div onclick="onClick(this)">${item.school_name}</div>`)
.join('')
})
})
Source:stackexchange.com