后台-element-plus的eltableColumn设置全局属性

vue3写法

main.ts

import ElementPlus from 'element-plus'

// 表格列
type ElementComponentsType = {
	ElTableColumn: {
		props: {
			showOverflowTooltip: any
		}
	}
}

// 注册全局组件
app.component('Pagination', Pagination)
	.use(createPinia())
	.use(router)
	.use(Dictionary)
	.use(ElementPlus, { locale })
	.use(i18n)
	.use(VXETable)
	.component('QtTable', QtTable)
	.mount('#app')
// 全局设置表格列超出隐藏提示
const ElementComponents = app._context.components as ElementComponentsType
ElementComponents.ElTableColumn.props.showOverflowTooltip = { type: Boolean, default: true }

vue2

main.js

import Element, { Message } from 'element-ui'

Element.TableColumn.props.showOverflowTooltip = { type: Boolean, default: true }
Element.Select.props.popperAppendToBody = { type: Boolean, default: false }

Vue.use(Element, { size: globalComponentSize })

你可能感兴趣的:(key后台项目,前端,vue.js,javascript)