Answers for "how to add link tag into html in vuejs"

1

vue add script tags and link tags

created() {
	let doc = document.createElement('script');  
	doc.setAttribute('src',"your-link-here");
	document.head.appendChild(doc);
}
Posted by: Guest on March-16-2021
0

vue on page link or anchor

//P.S. the code is written for Vue 2.
//You will have to adjust it to Vue 1.

//Your view:
// <a class="porto-button" @click="scrollMeTo('porto')">Porto, Portugal</a>
// ...
// <div ref="porto" class="fl-porto"> </div>




//Your code:
methods: {
  scrollMeTo(refName) {
    var element = this.$refs[refName];
    var top = element.offsetTop;

    window.scrollTo(0, top);
  }
}
Posted by: Guest on June-01-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language