File tree Expand file tree Collapse file tree 7 files changed +56
-4
lines changed Expand file tree Collapse file tree 7 files changed +56
-4
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,10 @@ export type ButtonProps = RouteProps & {
23
23
bottomAction ?: boolean ;
24
24
} ;
25
25
26
+ export type ButtonEvents = {
27
+ onClick ?( event : Event ) : void ;
28
+ } ;
29
+
26
30
const [ sfc , bem ] = use ( 'button' ) ;
27
31
28
32
function Button (
@@ -100,4 +104,4 @@ Button.props = {
100
104
}
101
105
} ;
102
106
103
- export default sfc < ButtonProps > ( Button ) ;
107
+ export default sfc < ButtonProps , ButtonEvents > ( Button ) ;
Original file line number Diff line number Diff line change @@ -32,6 +32,10 @@ export type CardSlots = DefaultSlots & {
32
32
'origin-price' ?: ScopedSlot ;
33
33
} ;
34
34
35
+ export type CardEvents = {
36
+ onClick ?( event : Event ) : void ;
37
+ } ;
38
+
35
39
const [ sfc , bem ] = use ( 'card' ) ;
36
40
37
41
function Card (
@@ -140,4 +144,4 @@ Card.props = {
140
144
}
141
145
} ;
142
146
143
- export default sfc < CardProps > ( Card ) ;
147
+ export default sfc < CardProps , CardEvents > ( Card ) ;
Original file line number Diff line number Diff line change @@ -140,6 +140,12 @@ export default {
140
140
| tel | Phone | ` String ` | - |
141
141
| add-text | Add card text | ` String ` | ` Add contact info ` |
142
142
143
+ ### ContactCard Event
144
+
145
+ | Event | Description | Arguments |
146
+ | ------| ------| ------|
147
+ | click | Triggered when clicked | - |
148
+
143
149
### ContactList API
144
150
145
151
| Attribute | Description | Type | Default |
Original file line number Diff line number Diff line change @@ -140,6 +140,12 @@ export default {
140
140
| tel | 联系人手机号 | ` String ` | - | - |
141
141
| add-text | 添加时的文案提示 | ` String ` | ` 添加订单联系人信息 ` | - |
142
142
143
+ ### ContactCard Event
144
+
145
+ | 事件名 | 说明 | 参数 |
146
+ | ------| ------| ------|
147
+ | click | 点击时触发 | - |
148
+
143
149
### ContactList API
144
150
145
151
| 参数 | 说明 | 类型 | 默认值 | 版本 |
Original file line number Diff line number Diff line change @@ -138,6 +138,7 @@ Field support all native events of input tag,such as `focus`、`blur`、`keypr
138
138
139
139
| Event | Description | Parameters |
140
140
| ------| ------| ------|
141
+ | input | Triggered when value changed | - |
141
142
| clear | Triggered when click clear icon | - |
142
143
| click-left-icon | Triggered when click the left icon of Field | - |
143
144
| click-right-icon | Triggered when click the right icon of Field | - |
Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ Field 默认支持 Input 标签所有的原生事件,如 `focus`、`blur`、`k
140
140
141
141
| 事件 | 说明 | 回调参数 |
142
142
| ------| ------| ------|
143
+ | input | 输入框内容变化时触发 | - |
143
144
| clear | 点击清除按钮后触发 | - |
144
145
| click-left-icon | 点击头部图标时触发 | - |
145
146
| click-right-icon | 点击尾部图标时触发 | - |
Original file line number Diff line number Diff line change @@ -2,9 +2,39 @@ import { use, noop } from '../utils';
2
2
import { inherit } from '../utils/functional' ;
3
3
import Icon from '../icon' ;
4
4
5
+ // Types
6
+ import { CreateElement , RenderContext } from 'vue/types' ;
7
+ import { ScopedSlot , DefaultSlots } from '../utils/use/sfc' ;
8
+
9
+ export type NavBarProps = {
10
+ title ?: string ;
11
+ fixed ?: boolean ;
12
+ zIndex ?: number ;
13
+ border ?: boolean ;
14
+ leftText ?: string ;
15
+ rightText ?: string ;
16
+ leftArrow ?: boolean ;
17
+ } ;
18
+
19
+ export type NavBarSlots = DefaultSlots & {
20
+ left ?: ScopedSlot ;
21
+ title ?: ScopedSlot ;
22
+ right ?: ScopedSlot ;
23
+ } ;
24
+
25
+ export type NavBarEvents = {
26
+ 'click-left' ?( event : Event ) : void ;
27
+ 'click-right' ?( event : Event ) : void ;
28
+ } ;
29
+
5
30
const [ sfc , bem ] = use ( 'nav-bar' ) ;
6
31
7
- function NavBar ( h , props , slots , ctx ) {
32
+ function NavBar (
33
+ h : CreateElement ,
34
+ props : NavBarProps ,
35
+ slots : NavBarSlots ,
36
+ ctx : RenderContext < NavBarProps >
37
+ ) {
8
38
return (
9
39
< div
10
40
class = { [
@@ -56,4 +86,4 @@ NavBar.props = {
56
86
}
57
87
} ;
58
88
59
- export default sfc ( NavBar ) ;
89
+ export default sfc < NavBarProps , NavBarEvents > ( NavBar ) ;
You can’t perform that action at this time.
0 commit comments