no message
This commit is contained in:
@@ -38,3 +38,15 @@ export const timestampToDate = (timestamp) => {
|
||||
var day = ("0" + date.getDate()).slice(-2); // Add leading 0.
|
||||
return `${year}-${month}-${day}`;
|
||||
}
|
||||
|
||||
|
||||
// isblank 是否需要 新标签页 默认是新标签页
|
||||
export const goToURL = (url, isblank = true) => {
|
||||
if (typeof document !== "object") return
|
||||
|
||||
let aTab = document.createElement('a')
|
||||
document.body.appendChild(aTab)
|
||||
aTab.setAttribute('href', url)
|
||||
if (isblank) aTab.setAttribute('target', "_blank")
|
||||
aTab.click()
|
||||
}
|
||||
Reference in New Issue
Block a user