From 35be7abe953703d4e9e6ff98e6ae3fa7167348a9 Mon Sep 17 00:00:00 2001 From: 07akioni <07akioni2@gmail.com> Date: Wed, 22 Jul 2020 13:29:27 +0800 Subject: [PATCH] chore: rename ConfigProvider & Consumer folder --- src/ConfigConsumer/index.js | 8 -------- src/ConfigProvider/index.js | 11 ----------- src/config-consumer/index.js | 8 ++++++++ .../src/ConfigConsumer.vue} | 7 +++++-- src/config-provider/index.js | 11 +++++++++++ .../src/ConfigProvider.vue} | 6 ++++-- .../src/installOsProperty.js | 0 src/index.js | 4 ++-- 8 files changed, 30 insertions(+), 25 deletions(-) delete mode 100644 src/ConfigConsumer/index.js delete mode 100644 src/ConfigProvider/index.js create mode 100644 src/config-consumer/index.js rename src/{ConfigConsumer/src/main.vue => config-consumer/src/ConfigConsumer.vue} (95%) create mode 100644 src/config-provider/index.js rename src/{ConfigProvider/src/main.vue => config-provider/src/ConfigProvider.vue} (97%) rename src/{ConfigProvider => config-provider}/src/installOsProperty.js (100%) diff --git a/src/ConfigConsumer/index.js b/src/ConfigConsumer/index.js deleted file mode 100644 index 5b28f1f12..000000000 --- a/src/ConfigConsumer/index.js +++ /dev/null @@ -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 diff --git a/src/ConfigProvider/index.js b/src/ConfigProvider/index.js deleted file mode 100644 index a817ffe1d..000000000 --- a/src/ConfigProvider/index.js +++ /dev/null @@ -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 diff --git a/src/config-consumer/index.js b/src/config-consumer/index.js new file mode 100644 index 000000000..97dcbbe27 --- /dev/null +++ b/src/config-consumer/index.js @@ -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 diff --git a/src/ConfigConsumer/src/main.vue b/src/config-consumer/src/ConfigConsumer.vue similarity index 95% rename from src/ConfigConsumer/src/main.vue rename to src/config-consumer/src/ConfigConsumer.vue index e71885bb0..d7b1a946c 100644 --- a/src/ConfigConsumer/src/main.vue +++ b/src/config-consumer/src/ConfigConsumer.vue @@ -4,8 +4,11 @@ import themeable from '../../_mixins/themeable' import styleScheme from '../../_utils/naive/styleScheme' export default { - name: 'NConfigConsumer', - mixins: [ withapp, themeable ], + name: 'ConfigConsumer', + mixins: [ + withapp, + themeable + ], watch: { syntheticTheme: function (value, oldValue) { this.$emit('theme-change', value, oldValue) diff --git a/src/config-provider/index.js b/src/config-provider/index.js new file mode 100644 index 000000000..da0fafd8a --- /dev/null +++ b/src/config-provider/index.js @@ -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 diff --git a/src/ConfigProvider/src/main.vue b/src/config-provider/src/ConfigProvider.vue similarity index 97% rename from src/ConfigProvider/src/main.vue rename to src/config-provider/src/ConfigProvider.vue index 0b0382a96..67cf4358c 100644 --- a/src/ConfigProvider/src/main.vue +++ b/src/config-provider/src/ConfigProvider.vue @@ -2,8 +2,10 @@ import themeable from '../../_mixins/themeable' export default { - name: 'NConfigProvider', - mixins: [themeable], + name: 'ConfigProvider', + mixins: [ + themeable + ], provide () { return { NConfigProvider: this diff --git a/src/ConfigProvider/src/installOsProperty.js b/src/config-provider/src/installOsProperty.js similarity index 100% rename from src/ConfigProvider/src/installOsProperty.js rename to src/config-provider/src/installOsProperty.js diff --git a/src/index.js b/src/index.js index 8d274aa24..cfe4bcafc 100644 --- a/src/index.js +++ b/src/index.js @@ -39,7 +39,7 @@ import Popconfirm from './Popconfirm' import Anchor from './Anchor' import Dropdown from './Dropdown' import Popselect from './Popselect' -import ConfigProvider from './ConfigProvider' +import ConfigProvider from './config-provider' import Transfer from './Transfer' import Spin from './Spin' import Drawer from './Drawer' @@ -51,7 +51,7 @@ import Grid from './Grid' import Affix from './Affix' import Statistic from './Statistic' import Breadcrumb from './Breadcrumb' -import ConfigConsumer from './ConfigConsumer' +import ConfigConsumer from './config-consumer' import Descriptions from './Descriptions' import List from './List' import Menu from './Menu'