initial: bootstrap from BukidBountyApp base
This commit is contained in:
41
resources/js/utils/Legacy/domHelpers.js
Normal file
41
resources/js/utils/Legacy/domHelpers.js
Normal file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @deprecated Use Vue refs or reactive state instead
|
||||
*/
|
||||
export function getElementHtml(id) {
|
||||
return document.getElementById(id)?.innerHTML ?? ''
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use Vue refs or reactive state instead
|
||||
*/
|
||||
export function setElementHtml(id, html) {
|
||||
const el = document.getElementById(id)
|
||||
if (el) el.innerHTML = html
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use v-model instead
|
||||
*/
|
||||
export function getElementValue(id) {
|
||||
return document.getElementById(id)?.value ?? ''
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use v-model instead
|
||||
*/
|
||||
export function setElementValue(id, value) {
|
||||
const el = document.getElementById(id)
|
||||
if (el) el.value = value
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use reactive state instead of DOM removal
|
||||
*/
|
||||
export function removeElementById(id) {
|
||||
const el = document.getElementById(id)
|
||||
if (el?.parentNode) {
|
||||
el.parentNode.removeChild(el)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
Reference in New Issue
Block a user