[new feature] Button: add url、to、replace prop (#2754)

This commit is contained in:
neverland
2019-02-15 19:28:20 +08:00
committed by GitHub
parent c5bd04e30a
commit 632cfbcf36
3 changed files with 9 additions and 1 deletions
+3
View File
@@ -1,5 +1,6 @@
import { use } from '../utils';
import { emit, inherit } from '../utils/functional';
import { routeProps, functionalRoute } from '../mixins/router';
import Loading from '../loading';
const [sfc, bem] = use('button');
@@ -10,6 +11,7 @@ function Button(h, props, slots, ctx) {
const onClick = event => {
if (!loading && !disabled) {
emit(ctx, 'click', event);
functionalRoute(ctx);
}
};
@@ -48,6 +50,7 @@ function Button(h, props, slots, ctx) {
}
Button.props = {
...routeProps,
text: String,
block: Boolean,
plain: Boolean,