++ + diff --git a/src/Typography/src/getTheme.js b/src/Typography/src/getTheme.js deleted file mode 100644 index 2d6ab45e8..000000000 --- a/src/Typography/src/getTheme.js +++ /dev/null @@ -1,11 +0,0 @@ -function getTheme (cursor) { - while (cursor) { - if (cursor.syntheticTheme) { - return cursor.syntheticTheme - } - cursor = cursor.$parent - } - return null -} - -export default getTheme diff --git a/src/Typography/src/header.js b/src/Typography/src/header.js index 0a0c35b4b..3bdb05e4c 100644 --- a/src/Typography/src/header.js +++ b/src/Typography/src/header.js @@ -1,8 +1,8 @@ -import getTheme from './getTheme' +import withapp from '../../_mixins/withapp' +import themeable from '../../_mixins/themeable' export default level => ({ name: 'NH' + level, - functional: true, props: { type: { type: String, @@ -17,21 +17,18 @@ export default level => ({ default: false } }, - render (h, context) { - const props = context.props - const on = context.listeners - const theme = getTheme(context.parent) - const defaultSlot = context.slots.default || (context.scopedSlots.default && context.scopedSlots.default()) + mixins: [withapp, themeable], + render (h) { + const props = this.$props + const defaultSlot = this.$slots.default return h(`h${level}`, { class: { [`n-h${level}`]: true, - [`n-${theme}-theme`]: theme, + [`n-${this.syntheticTheme}-theme`]: this.syntheticTheme, [`n-h${level}--${props.type}-type`]: props.type, [`n-h${level}--prefix-bar`]: props.prefix, [`n-h${level}--align-text`]: props.alignText - }, - ...context.data, - on + } }, defaultSlot) } }) diff --git a/src/Typography/src/hr.vue b/src/Typography/src/hr.vue index 5e9e286dc..ba46d7d23 100644 --- a/src/Typography/src/hr.vue +++ b/src/Typography/src/hr.vue @@ -1,21 +1,20 @@ + ++
+
+