omip - fix compiling error of component
This commit is contained in:
parent
1818c7d0ee
commit
ea1f7f8531
|
@ -1,7 +1,5 @@
|
|||
|
||||
import { WeElement, define } from 'omi'
|
||||
import '../../components/my-element'
|
||||
|
||||
import './index.css'
|
||||
|
||||
//获取应用实例
|
||||
|
|
|
@ -3,7 +3,7 @@ import { WeElement, define } from 'omi'
|
|||
//兼容 omi 下划线?
|
||||
import './index.css'
|
||||
|
||||
define('my-logs', class extends WeElement {
|
||||
define('page-logs', class extends WeElement {
|
||||
data = {
|
||||
logs: []
|
||||
}
|
||||
|
|
|
@ -142,6 +142,16 @@ class Transformer {
|
|||
this.sourcePath = sourcePath
|
||||
//@fix add arg => componentSourceMap
|
||||
this.componentSourceMap = componentSourceMap
|
||||
//@fix import 却没使用的自定义组件
|
||||
for (let key of this.componentSourceMap) {
|
||||
const arr = key[0].split('/')
|
||||
if (arr[arr.length - 1].indexOf('-') !== -1 && key[0].indexOf('components/') !== -1 && key[1].length === 0) {
|
||||
this.customComponents.set(arr[arr.length - 1], {
|
||||
sourcePath: key[0],
|
||||
type: 'default'
|
||||
});
|
||||
}
|
||||
}
|
||||
this.moduleNames = Object.keys(path.scope.getAllBindings('module'))
|
||||
this.componentProperies = new Set(componentProperies)
|
||||
this.compile()
|
||||
|
|
Loading…
Reference in New Issue