mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(components): [date-picker] date-table-cell namespace (#7684)
* fix(components): date-table-cell & scrollbar namespace * fix(components): revert scroll className & add comment
This commit is contained in:
1
docs/components.d.ts
vendored
1
docs/components.d.ts
vendored
@@ -44,7 +44,6 @@ declare module '@vue/runtime-core' {
|
||||
Playground: typeof import('./.vitepress/vitepress/components/icons/playground.vue')['default']
|
||||
Resource: typeof import('./.vitepress/vitepress/components/globals/resource.vue')['default']
|
||||
ResourceSvg: typeof import('./.vitepress/vitepress/components/home/svg/resource-svg.vue')['default']
|
||||
Right: typeof import('./.vitepress/vitepress/components/sponsors/right.vue')['default']
|
||||
RightLayerSvg: typeof import('./.vitepress/vitepress/components/home/svg/right-layer-svg.vue')['default']
|
||||
RightRichtextList: typeof import('./.vitepress/vitepress/components/sponsors/right-richtext-list.vue')['default']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { defineComponent, h, inject } from 'vue'
|
||||
import { buildProps, definePropType } from '@element-plus/utils'
|
||||
import { useNamespace } from '@element-plus/hooks'
|
||||
import { ROOT_PICKER_INJECTION_KEY } from '../date-picker.type'
|
||||
import type { DateCell } from '../date-picker.type'
|
||||
|
||||
@@ -11,6 +12,7 @@ export default defineComponent({
|
||||
},
|
||||
}),
|
||||
setup(props) {
|
||||
const ns = useNamespace('date-table-cell')
|
||||
const picker = inject(ROOT_PICKER_INJECTION_KEY)
|
||||
return () => {
|
||||
const cell = props.cell
|
||||
@@ -27,13 +29,13 @@ export default defineComponent({
|
||||
return h(
|
||||
'div',
|
||||
{
|
||||
class: 'el-date-table-cell',
|
||||
class: ns.b(),
|
||||
},
|
||||
[
|
||||
h(
|
||||
'span',
|
||||
{
|
||||
class: 'el-date-table-cell__text',
|
||||
class: ns.e('text'),
|
||||
},
|
||||
[cell?.text]
|
||||
),
|
||||
|
||||
@@ -40,6 +40,8 @@ export const getScrollBarWidth = (): number => {
|
||||
if (scrollBarWidth !== undefined) return scrollBarWidth
|
||||
|
||||
const outer = document.createElement('div')
|
||||
// Cannot access 'propKey' before initialization
|
||||
// need to be dynamic namespace
|
||||
outer.className = 'el-scrollbar__wrap'
|
||||
outer.style.visibility = 'hidden'
|
||||
outer.style.width = '100px'
|
||||
|
||||
Reference in New Issue
Block a user