web-component-gallery 2.0.3 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/js.umd.js +1 -1
- package/extensions/Theme.js +1 -5
- package/extensions/index.js +2 -13
- package/lib/icon-font/index.js +4 -4
- package/package.json +1 -1
package/extensions/Theme.js
CHANGED
|
@@ -57,12 +57,8 @@ export default {
|
|
|
57
57
|
|
|
58
58
|
/** 切换主题资源 */
|
|
59
59
|
function ToggleThemeSource(scopeName) {
|
|
60
|
-
// 先检测模块是否存在
|
|
61
|
-
const modulePath = '@zougt/theme-css-extract-webpack-plugin/dist/toggleTheme'
|
|
62
|
-
|
|
63
60
|
try {
|
|
64
|
-
require
|
|
65
|
-
const { toggleTheme } = require(modulePath)
|
|
61
|
+
const { toggleTheme } = require('@zougt/theme-css-extract-webpack-plugin/dist/toggleTheme')
|
|
66
62
|
/** 获取初始配置项 */
|
|
67
63
|
// env.themeConfig 来源 vue.config.js define (webpack的DefinePlugin)
|
|
68
64
|
const themeConfig = env.themeConfig || {}
|
package/extensions/index.js
CHANGED
|
@@ -22,17 +22,7 @@ import PageLoading from "./PageLoading"
|
|
|
22
22
|
* 全局切换主题
|
|
23
23
|
* @theme 主题key 使用方法: this.$setTheme(@theme)
|
|
24
24
|
* */
|
|
25
|
-
import setTheme from './Theme'
|
|
26
|
-
|
|
27
|
-
/** 全局组件配置(iconfont地址等 */
|
|
28
|
-
export let webGallery = {
|
|
29
|
-
// iconFont库地址
|
|
30
|
-
iconFontJs: '//at.alicdn.com/t/c/font_4641025_tdg12oa0nfq.js'
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const setWebGallery = (config) => {
|
|
34
|
-
webGallery = { ...webGallery, ...config }
|
|
35
|
-
}
|
|
25
|
+
import setTheme from './Theme'
|
|
36
26
|
|
|
37
27
|
export default {
|
|
38
28
|
install(Vue) {
|
|
@@ -60,6 +50,5 @@ export default {
|
|
|
60
50
|
Vue.use(Dialog)
|
|
61
51
|
Vue.use(PageLoading)
|
|
62
52
|
Vue.use(setTheme)
|
|
63
|
-
}
|
|
64
|
-
setWebGallery
|
|
53
|
+
}
|
|
65
54
|
}
|
package/lib/icon-font/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Icon } from 'ant-design-vue/es'
|
|
2
|
-
import { webGallery } from '../../extensions'
|
|
3
2
|
|
|
4
3
|
const IconFont = {
|
|
5
4
|
name: 'IconFont',
|
|
6
5
|
props: {
|
|
7
6
|
scriptUrl: {
|
|
8
7
|
type: String,
|
|
9
|
-
default:
|
|
8
|
+
default: '//at.alicdn.com/t/c/font_4641025_tdg12oa0nfq.js'
|
|
10
9
|
},
|
|
11
10
|
type: {
|
|
12
11
|
type: String,
|
|
@@ -18,11 +17,12 @@ const IconFont = {
|
|
|
18
17
|
return Icon.createFromIconfontCN({
|
|
19
18
|
scriptUrl: this.scriptUrl
|
|
20
19
|
})
|
|
21
|
-
}
|
|
20
|
+
}
|
|
22
21
|
},
|
|
23
22
|
render() {
|
|
23
|
+
const {$props: props = {}, $attrs: attrs = {} } = this
|
|
24
24
|
const IconComponent = this.iconType
|
|
25
|
-
return <IconComponent {...{
|
|
25
|
+
return <IconComponent {...{ props, attrs }} on={{ ...this.$listeners }} />
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|