mirror of
https://gitee.com/dromara/go-view.git
synced 2025-02-24 16:22:57 +08:00
fix: 解决首页注册组件的bug
This commit is contained in:
parent
e6a99302d6
commit
5b14e3a70f
@ -10,8 +10,9 @@ import { CreateComponentType } from '@/packages/index.d'
|
|||||||
* @param app
|
* @param app
|
||||||
*/
|
*/
|
||||||
export const setupPreviewPackages = (app: App) => {
|
export const setupPreviewPackages = (app: App) => {
|
||||||
|
if(!document.location.hash.includes('preview')) return
|
||||||
const localStorageInfo = getLocalStorageInfo()
|
const localStorageInfo = getLocalStorageInfo()
|
||||||
if(!document.location.hash.includes('preview') || !localStorageInfo) return
|
if(!localStorageInfo) return
|
||||||
localStorageInfo.componentList.forEach(async (e: CreateComponentType) => {
|
localStorageInfo.componentList.forEach(async (e: CreateComponentType) => {
|
||||||
if (!app.component(e.key)) {
|
if (!app.component(e.key)) {
|
||||||
const chart = fetchChartComponent(e.chartConfig)
|
const chart = fetchChartComponent(e.chartConfig)
|
||||||
|
@ -15,6 +15,8 @@ export const getLocalStorageInfo = () => {
|
|||||||
StorageEnum.GO_CHART_STORAGE_LIST
|
StorageEnum.GO_CHART_STORAGE_LIST
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(!storageList) return
|
||||||
|
|
||||||
for (let i = 0; i < storageList.length; i++) {
|
for (let i = 0; i < storageList.length; i++) {
|
||||||
if (id.toString() === storageList[i]['id']) {
|
if (id.toString() === storageList[i]['id']) {
|
||||||
return storageList[i]
|
return storageList[i]
|
||||||
|
Loading…
Reference in New Issue
Block a user