UNPKG

iep-ui

Version:

An enterprise-class UI design language and Vue-based implementation

71 lines (65 loc) 1.79 kB
import PropTypes from '../_util/vue-types'; import { ConfigConsumerProps } from '../config-provider/configConsumerProps'; import Button from '../button'; import download from '../toolkits/download'; export default { name: 'IepBusinessExport', props: { url: PropTypes.string, fileName: PropTypes.string, params: PropTypes.object, methods: PropTypes.string.def('get'), suffix: PropTypes.string, headers: PropTypes.object }, inject: { configProvider: { 'default': function _default() { return ConfigConsumerProps; } } }, methods: { handleTap: function handleTap() { var _$props = this.$props, url = _$props.url, params = _$props.params, fileName = _$props.fileName, headers = _$props.headers, suffix = _$props.suffix, methods = _$props.methods; return download(url, params, fileName, headers, suffix, methods); } }, render: function render() { var _this = this; var h = arguments[0]; var customizePrefixCls = this.prefixCls; var getPrefixCls = this.configProvider.getPrefixCls; var prefixCls = getPrefixCls('business-export', customizePrefixCls); return h( 'div', { 'class': prefixCls }, [true.$slots['default'] ? h( 'span', { on: { 'click': function click() { return _this.handleTap(); } } }, [true.$slots['default']] ) : h( Button, { attrs: { type: 'primary', icon: 'basic_linear_directive_export3' }, on: { 'click': function click() { return _this.handleTap(); } } }, ['\u5BFC\u51FA'] )] ); } };