File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 15
15
type: String ,
16
16
default: ' button'
17
17
},
18
- disabled: Boolean ,
19
- mdRipple: {
20
- type: Boolean ,
21
- default: true
22
- },
23
- to: [String , Object ]
18
+ disabled: Boolean
24
19
},
25
20
render (createElement ) {
26
21
const buttonContent = createElement (' md-button-content' , {
53
48
if (this .href ) {
54
49
tag = ' a'
55
50
} else if (this .$router && this .to ) {
51
+ buttonAttrs .props = this .$props
56
52
tag = ' router-link'
57
- buttonAttrs .attrs = {
58
- ... this .$options .propsData ,
59
- to: this .to
60
- }
61
53
}
62
54
63
55
return createElement (tag, buttonAttrs, [buttonContent])
Original file line number Diff line number Diff line change 1
1
import MdButton from './MdButton'
2
2
3
3
export default Vue => {
4
+ const routerLinkProps = Vue . options . components [ 'router-link' ] . options . props
5
+
6
+ delete routerLinkProps . to . required
7
+
8
+ MdButton . props = {
9
+ ...MdButton . props ,
10
+ ...routerLinkProps
11
+ }
12
+
4
13
Vue . component ( MdButton . name , MdButton )
5
14
}
You can’t perform that action at this time.
0 commit comments