优化
This commit is contained in:
@@ -38,6 +38,9 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { useMobileTable } from '@/composables/useMobileTable'
|
||||
import { watch, nextTick, onMounted } from 'vue'
|
||||
|
||||
defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
@@ -48,6 +51,23 @@ defineProps({
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
|
||||
// 移动端表格优化
|
||||
const { isMobile, removeFixedColumns } = useMobileTable()
|
||||
|
||||
// 监听表格内容变化,重新应用优化
|
||||
watch(() => isMobile.value, () => {
|
||||
nextTick(() => {
|
||||
removeFixedColumns()
|
||||
})
|
||||
})
|
||||
|
||||
// 在组件挂载后应用优化
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
removeFixedColumns()
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user