1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
| import _extends from "@babel/runtime/helpers/esm/extends";
| import { createNamespace } from '../utils';
| import { route, routeProps } from '../utils/router';
| import { ChildrenMixin } from '../mixins/relation';
| import Button from '../button';
|
| var _createNamespace = createNamespace('goods-action-button'),
| createComponent = _createNamespace[0],
| bem = _createNamespace[1];
|
| export default createComponent({
| mixins: [ChildrenMixin('vanGoodsAction')],
| props: _extends({}, routeProps, {
| type: String,
| text: String,
| icon: String,
| color: String,
| loading: Boolean,
| disabled: Boolean
| }),
| computed: {
| isFirst: function isFirst() {
| var prev = this.parent && this.parent.children[this.index - 1];
| return !prev || prev.$options.name !== this.$options.name;
| },
| isLast: function isLast() {
| var next = this.parent && this.parent.children[this.index + 1];
| return !next || next.$options.name !== this.$options.name;
| }
| },
| methods: {
| onClick: function onClick(event) {
| this.$emit('click', event);
| route(this.$router, this);
| }
| },
| render: function render() {
| var h = arguments[0];
| return h(Button, {
| "class": bem([{
| first: this.isFirst,
| last: this.isLast
| }, this.type]),
| "attrs": {
| "size": "large",
| "type": this.type,
| "icon": this.icon,
| "color": this.color,
| "loading": this.loading,
| "disabled": this.disabled
| },
| "on": {
| "click": this.onClick
| }
| }, [this.slots() || this.text]);
| }
| });
|
|