$(document).ready(function(){
$('#content a').attr('target', '_blank');
});
window.onload = function(){
var anchors = document.getElementById('content').getElementsByTagName('a');
for (var i=0; i<anchors.length; i++){
anchors[i].setAttribute('target', '_blank');
}
}
$('#content a').each(function() {
var linky = new RegExp('/' + window.location.host + '/');
if (!linky.test(this.href)) {
$(this).attr("target","_blank");
}
});
<div id="app" @click="onClick">
...
new Vue({
el: '#app',
methods: {
onClick(e) {
if (e.target.tagName === 'A') {
e.preventDefault();
window.open(e.target.getAttribute('href'));
}
},
...
},
...
});