I’m fetching data from an API via Vuex store. The main content of each post have external links which are giving errors on click. How can i add “external” attribute to all links inside content?
I tried this in onMounted hook but it’s not working. Any suggestion please.
onMounted(() => {
var arrAnchors = document.getElementById("listing-content").getElementsByTagName("a"), i;
for(i=0; i<arrAnchors.length; i++) {
arrAnchors[i].setAttribute("external", "");
}
store.dispatch('jobSingle', { slug: props.f7route.params.slug });
});