You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.2 KiB
37 lines
1.2 KiB
import type { App } from 'vue'
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
export function clientTable(app: App<Element>) {
|
|
app.directive('clientTable', (el, binding) => {
|
|
nextTick(() => {
|
|
const top = el.getBoundingClientRect().top
|
|
////--top-tool-height:50 --tags-view-height:35
|
|
const qustionHeight = 20
|
|
let paginationHeight = 0
|
|
if(el.children&&el.children.length>1){
|
|
paginationHeight = 70
|
|
}
|
|
const height = window.innerHeight - top - paginationHeight - qustionHeight
|
|
el.style.height = height + 'px'
|
|
el.firstChild.style.height = '100%'
|
|
})
|
|
})
|
|
app.directive('clientSearchTable', (el, binding) => {
|
|
nextTick(() => {
|
|
const top = el.getBoundingClientRect().top
|
|
const qustionHeight = 150
|
|
let paginationHeight = 0
|
|
if(el.children&&el.children.length>1){
|
|
paginationHeight = 70
|
|
}
|
|
const height = window.innerHeight - top - paginationHeight - qustionHeight
|
|
if(el.getBoundingClientRect().height>height){
|
|
console.log('高度',el.getBoundingClientRect().height)
|
|
el.style.height = height + 'px'
|
|
el.firstChild.style.height = '100%'
|
|
}
|
|
})
|
|
})
|
|
}
|
|
|