Files
cdTestPlant3/cdTMP/src/views/project/opeSets/components/DesignTable/useSettings.ts
2025-05-10 19:21:50 +08:00

27 lines
771 B
TypeScript

import { nextTick, provide, reactive, ref } from "vue"
import MySetting from "../TableCommonComponent/Setting.vue"
export default function useSettings() {
const settingRef = ref<InstanceType<typeof MySetting> | null>(null)
// 表格配置
const options = reactive({
bordered: {
wrapper: true,
cell: true
},
size: "small",
stripe: false
})
provide("options", options)
// 处理函数
const tableIsShow = ref(true)
const clickSetting = () => {
settingRef.value!.open()
}
const changeColumn = async () => {
tableIsShow.value = false
await nextTick(() => (tableIsShow.value = true))
}
return { options, clickSetting, changeColumn, settingRef }
}