chore: rename ConfigProvider & Consumer folder

This commit is contained in:
07akioni 2020-07-22 13:29:27 +08:00
parent c58214e89b
commit 35be7abe95
8 changed files with 30 additions and 25 deletions

View File

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

View File

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

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
import ConfigConsumer from './src/ConfigConsumer.vue'
ConfigConsumer.install = function (Vue, naive) {
Vue.component(naive.componentPrefix + ConfigConsumer.name, ConfigConsumer)
}
export default ConfigConsumer

View File

@ -4,8 +4,11 @@ import themeable from '../../_mixins/themeable'
import styleScheme from '../../_utils/naive/styleScheme' import styleScheme from '../../_utils/naive/styleScheme'
export default { export default {
name: 'NConfigConsumer', name: 'ConfigConsumer',
mixins: [ withapp, themeable ], mixins: [
withapp,
themeable
],
watch: { watch: {
syntheticTheme: function (value, oldValue) { syntheticTheme: function (value, oldValue) {
this.$emit('theme-change', value, oldValue) this.$emit('theme-change', value, oldValue)

View File

@ -0,0 +1,11 @@
/* istanbul ignore file */
import ConfigProvider from './src/ConfigProvider.vue'
import installOsProperty from './src/installOsProperty'
ConfigProvider.install = function (Vue, naive) {
Vue.component(naive.componentPrefix + ConfigProvider.name, ConfigProvider)
Vue.component(naive.componentPrefix + 'App', ConfigProvider) // deprecated
installOsProperty(Vue)
}
export default ConfigProvider

View File

@ -2,8 +2,10 @@
import themeable from '../../_mixins/themeable' import themeable from '../../_mixins/themeable'
export default { export default {
name: 'NConfigProvider', name: 'ConfigProvider',
mixins: [themeable], mixins: [
themeable
],
provide () { provide () {
return { return {
NConfigProvider: this NConfigProvider: this

View File

@ -39,7 +39,7 @@ import Popconfirm from './Popconfirm'
import Anchor from './Anchor' import Anchor from './Anchor'
import Dropdown from './Dropdown' import Dropdown from './Dropdown'
import Popselect from './Popselect' import Popselect from './Popselect'
import ConfigProvider from './ConfigProvider' import ConfigProvider from './config-provider'
import Transfer from './Transfer' import Transfer from './Transfer'
import Spin from './Spin' import Spin from './Spin'
import Drawer from './Drawer' import Drawer from './Drawer'
@ -51,7 +51,7 @@ import Grid from './Grid'
import Affix from './Affix' import Affix from './Affix'
import Statistic from './Statistic' import Statistic from './Statistic'
import Breadcrumb from './Breadcrumb' import Breadcrumb from './Breadcrumb'
import ConfigConsumer from './ConfigConsumer' import ConfigConsumer from './config-consumer'
import Descriptions from './Descriptions' import Descriptions from './Descriptions'
import List from './List' import List from './List'
import Menu from './Menu' import Menu from './Menu'