feat(n-element)

This commit is contained in:
07akioni 2019-12-07 00:02:14 +08:00
parent a3b970ffe2
commit ffc943954d
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,9 @@
/* istanbul ignore file */
import Element from './src/main.vue'
Element.install = function (Vue) {
Vue.component(Element.name, Element)
Vue.component('NEl', Element)
}
export default Element

View File

@ -0,0 +1,23 @@
<script>
import withapp from '../../../mixins/withapp'
import themeable from '../../../mixins/themeable'
import asthemecontext from '../../../mixins/asthemecontext'
export default {
name: 'NElement',
mixins: [withapp, themeable, asthemecontext],
props: {
as: {
type: String,
default: 'div'
}
},
render (h) {
return h(this.as, {
class: {
[`n-${this.synthesizedTheme}-theme`]: this.synthesizedTheme
}
}, this.$slots.default || (this.$scopedSlots.default && this.$scopedSlots.default()) || null)
}
}
</script>