feat: hideSurelyVueTableWatermark
This commit is contained in:
parent
cefb806385
commit
5a32519cd7
|
|
@ -14,11 +14,18 @@
|
||||||
// 3. If you choose to use the method in this project to remove the watermark in the online project, you can only bear all the consequences
|
// 3. If you choose to use the method in this project to remove the watermark in the online project, you can only bear all the consequences
|
||||||
// 4. D2Admin (https://github.com/d2-projects/d2-admin) does not use this method to hide watermarks in any production environment
|
// 4. D2Admin (https://github.com/d2-projects/d2-admin) does not use this method to hide watermarks in any production environment
|
||||||
|
|
||||||
export function hideSurelyTableWatermark () {
|
export function hideSurelyVueTableWatermark () {
|
||||||
if (import.meta.env.PROD) return
|
if (import.meta.env.PROD || location.hostname !== 'localhost') return
|
||||||
if (location.hostname !== 'localhost') return
|
clean(
|
||||||
document.querySelectorAll('div.surely-table > div.surely-table-body > div')
|
'div.surely-table > div',
|
||||||
.forEach(e => e.innerHTML === 'Powered by Surely Vue' && (e.innerHTML = ''))
|
['Unlicensed Product', 'Invalid License']
|
||||||
document.querySelectorAll('div.surely-table > div')
|
)
|
||||||
.forEach(e => ['Unlicensed Product', 'Invalid License'].includes(e.innerHTML) && (e.innerHTML = ''))
|
clean(
|
||||||
|
'div.surely-table > div.surely-table-body > div',
|
||||||
|
['Powered by Surely Vue']
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function clean (selector, text) {
|
||||||
|
document.querySelectorAll(selector).forEach(e => text.includes(e.innerHTML) && (e.innerHTML = ''))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { defineComponent, ref, onMounted } from 'vue'
|
import { defineComponent, ref, onMounted } from 'vue'
|
||||||
import { hideSurelyTableWatermark } from 'd2/utils/helper/surely-vue.js'
|
import { hideSurelyVueTableWatermark } from 'd2/utils/helper/surely-vue.js'
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: 'Full Name', dataIndex: 'name' },
|
{ title: 'Full Name', dataIndex: 'name' },
|
||||||
|
|
@ -35,7 +35,7 @@ export default defineComponent({
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
hideSurelyTableWatermark()
|
hideSurelyVueTableWatermark()
|
||||||
})
|
})
|
||||||
return {
|
return {
|
||||||
stable,
|
stable,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue