forked from opentiny/tiny-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib.js
More file actions
20 lines (16 loc) · 707 Bytes
/
Copy pathlib.js
File metadata and controls
20 lines (16 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { hyphenate } from '@vue/shared'
import { defineCustomElement } from '@opentiny/tiny-engine-webcomponent-core'
import block from './BlockFileName.vue'
window.TinyLowcodeResource = window.TinyLowcodeResource || {}
const blockName = hyphenate('BlockFileName')
if (customElements.get(blockName)) {
if (window.TinyLowcodeResource[blockName]) {
Object.assign(window.TinyLowcodeResource[blockName], block)
}
} else {
block.links = process.env.VUE_APP_UI_LIB_FULL_STYLE_FILE_URL
block.styles = ['svg { width: 10px; height: 10px;}', ...(block.styles || [])]
window.TinyLowcodeResource[blockName] = block
customElements.define(blockName, defineCustomElement(block))
}
export default block