File tree 5 files changed +21
-19
lines changed
5 files changed +21
-19
lines changed Original file line number Diff line number Diff line change 1
1
import { Col } from '../grid' ;
2
- import Base from '../base' ;
3
2
/* istanbul ignore next */
4
- Col . install = function ( Vue ) {
5
- Vue . use ( Base ) ;
6
- Vue . component ( Col . name , Col ) ;
3
+ Col . install = function ( app ) {
4
+ app . component ( Col . name , Col ) ;
7
5
} ;
8
6
9
7
export default Col ;
Original file line number Diff line number Diff line change
1
+ import { inject } from 'vue' ;
1
2
import PropTypes from '../_util/vue-types' ;
2
3
import { ConfigConsumerProps } from '../config-provider' ;
3
- import { getListeners } from '../_util/props-util' ;
4
4
5
5
const stringOrNumber = PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] ) ;
6
6
@@ -32,11 +32,11 @@ export const ColProps = {
32
32
export default {
33
33
name : 'ACol' ,
34
34
props : ColProps ,
35
- inject : {
36
- configProvider : { default : ( ) => ConfigConsumerProps } ,
37
- rowContext : {
38
- default : ( ) => null ,
39
- } ,
35
+ setup ( ) {
36
+ return {
37
+ configProvider : inject ( 'configProvider' , ConfigConsumerProps ) ,
38
+ rowContext : inject ( 'rowContext' , null ) ,
39
+ } ;
40
40
} ,
41
41
render ( ) {
42
42
const {
@@ -82,7 +82,6 @@ export default {
82
82
...sizeClassObj ,
83
83
} ;
84
84
const divProps = {
85
- on : getListeners ( this ) ,
86
85
class : classes ,
87
86
style : { } ,
88
87
} ;
@@ -105,6 +104,6 @@ export default {
105
104
} ;
106
105
}
107
106
}
108
- return < div { ...divProps } > { $slots . default } </ div > ;
107
+ return < div { ...divProps } > { $slots . default && $slots . default ( ) } </ div > ;
109
108
} ,
110
109
} ;
Original file line number Diff line number Diff line change
1
+ import { inject } from 'vue' ;
1
2
import PropTypes from '../_util/vue-types' ;
2
3
import BaseMixin from '../_util/BaseMixin' ;
3
4
import { ConfigConsumerProps } from '../config-provider' ;
@@ -25,8 +26,10 @@ export default {
25
26
rowContext : this ,
26
27
} ;
27
28
} ,
28
- inject : {
29
- configProvider : { default : ( ) => ConfigConsumerProps } ,
29
+ setup ( ) {
30
+ return {
31
+ configProvider : inject ( 'configProvider' , ConfigConsumerProps ) ,
32
+ } ;
30
33
} ,
31
34
data ( ) {
32
35
return {
@@ -101,7 +104,7 @@ export default {
101
104
} ;
102
105
return (
103
106
< div class = { classes } style = { rowStyle } >
104
- { $slots . default }
107
+ { $slots . default && $slots . default ( ) }
105
108
</ div >
106
109
) ;
107
110
} ,
Original file line number Diff line number Diff line change 1
1
import { Row } from '../grid' ;
2
- import Base from '../base' ;
3
2
4
3
/* istanbul ignore next */
5
- Row . install = function ( Vue ) {
6
- Vue . use ( Base ) ;
7
- Vue . component ( Row . name , Row ) ;
4
+ Row . install = function ( app ) {
5
+ app . component ( Row . name , Row ) ;
8
6
} ;
9
7
10
8
export default Row ;
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ import PageHeader from 'ant-design-vue/page-header';
17
17
import Skeleton from 'ant-design-vue/skeleton' ;
18
18
import Empty from 'ant-design-vue/empty' ;
19
19
import Timeline from 'ant-design-vue/timeline' ;
20
+ import Col from 'ant-design-vue/col' ;
21
+ import Row from 'ant-design-vue/row' ;
20
22
import 'ant-design-vue/style.js' ;
21
23
22
24
createApp ( App )
@@ -36,4 +38,6 @@ createApp(App)
36
38
. use ( Spin )
37
39
. use ( Empty )
38
40
. use ( Timeline )
41
+ . use ( Col )
42
+ . use ( Row )
39
43
. mount ( '#app' ) ;
You can’t perform that action at this time.
0 commit comments