refactor(components): refactor row

This commit is contained in:
undefined-design
2021-11-05 23:34:46 +08:00
committed by 三咲智子
parent 03b86d69b4
commit ae5b02df0d
2 changed files with 27 additions and 28 deletions

View File

@ -1,13 +1,7 @@
import { withInstall } from '@element-plus/utils/with-install'
import Row from './src/row' import Row from './src/row'
import type { App } from 'vue' export const ElRow = withInstall(Row)
import type { SFCWithInstall } from '@element-plus/utils/types' export default ElRow
const _Row = Row as SFCWithInstall<typeof Row> export * from './src/row'
_Row.install = (app: App) => {
app.component(_Row.name, _Row)
}
export default _Row
export const ElRow = _Row

View File

@ -1,8 +1,8 @@
import { defineComponent, computed, h, provide } from 'vue' import { defineComponent, computed, h, provide } from 'vue'
import { buildProps } from '@element-plus/utils/props'
import type { ExtractPropTypes } from 'vue'
export default defineComponent({ export const rowProps = buildProps({
name: 'ElRow',
props: {
tag: { tag: {
type: String, type: String,
default: 'div', default: 'div',
@ -19,7 +19,12 @@ export default defineComponent({
type: String, type: String,
default: 'top', default: 'top',
}, },
}, } as const)
export type RowProps = ExtractPropTypes<typeof rowProps>
export default defineComponent({
name: 'ElRow',
props: rowProps,
setup(props, { slots }) { setup(props, { slots }) {
const gutter = computed(() => props.gutter) const gutter = computed(() => props.gutter)
provide('ElRow', { provide('ElRow', {