0
在一個組件中,我正在更改掛載()中的標題和描述,但是我想創建一個全局函數,所以我可以重用下面的代碼。Vuejs 2創建一個全局函數並傳遞參數
我該如何做到這一點?
window.document.title = 111;
document.head.querySelector('meta[name=description]').content = 222;
function getTitle(title){
return window.document.title = title;
}