|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
import { inject } from 'vue'; |
|
|
|
|
import PropTypes from '../_util/vue-types'; |
|
|
|
|
import { ConfigConsumerProps } from '../config-provider'; |
|
|
|
|
import Base from '../base'; |
|
|
|
|
|
|
|
|
|
const Divider = { |
|
|
|
|
name: 'ADivider', |
|
|
|
@ -10,8 +10,10 @@ const Divider = {
|
|
|
|
|
dashed: PropTypes.bool, |
|
|
|
|
orientation: PropTypes.oneOf(['left', 'right', 'center']), |
|
|
|
|
}, |
|
|
|
|
inject: { |
|
|
|
|
configProvider: { default: () => ConfigConsumerProps }, |
|
|
|
|
setup() { |
|
|
|
|
return { |
|
|
|
|
configProvider: inject('configProvider', ConfigConsumerProps), |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
render() { |
|
|
|
|
const { prefixCls: customizePrefixCls, type, $slots, dashed, orientation = 'center' } = this; |
|
|
|
@ -28,16 +30,17 @@ const Divider = {
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<div class={classString} role="separator"> |
|
|
|
|
{$slots.default && <span class={`${prefixCls}-inner-text`}>{$slots.default}</span>} |
|
|
|
|
{$slots.default && $slots.default() && ( |
|
|
|
|
<span class={`${prefixCls}-inner-text`}>{$slots.default()}</span> |
|
|
|
|
)} |
|
|
|
|
</div> |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/* istanbul ignore next */ |
|
|
|
|
Divider.install = function(Vue) { |
|
|
|
|
Vue.use(Base); |
|
|
|
|
Vue.component(Divider.name, Divider); |
|
|
|
|
Divider.install = function(app) { |
|
|
|
|
app.component(Divider.name, Divider); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
export default Divider; |
|
|
|
|