refactor: 移动方法位置

This commit is contained in:
wsgh0202 2025-08-29 19:13:02 +08:00
parent f381226346
commit d4ef2e6bc9
No known key found for this signature in database
GPG Key ID: F9658C3FEDCF6979
6 changed files with 21 additions and 22 deletions

View File

@ -2,8 +2,9 @@ import { defineComponentMetadata } from '@/components/define'
import { ComponentEntry } from '@/components/types'
import { addComponentListener } from '@/core/settings'
import { select, selectAll } from '@/core/spin-query'
import { createComponentWithProps } from '@/core/utils'
import { useScopedConsole } from '@/core/utils/log'
import { createComponentWithProps, RadioItem } from '@/ui'
import { RadioItem } from '@/ui'
const componentName = 'hideHomeCarousel'

View File

@ -1,6 +1,7 @@
import { createComponentWithProps, RadioItem } from '@/ui'
import { RadioItem } from '@/ui'
import { ComponentEntry } from '@/components/types'
import { defineComponentMetadata } from '@/components/define'
import { createComponentWithProps } from '@/core/utils'
const componentName = 'removePromotions'

View File

@ -10,5 +10,5 @@
"include": [
"../src/**/*.d.ts",
"lib/**/*.ts"
, "../src/ui/vue-component-factory.ts" ],
],
}

View File

@ -714,3 +714,19 @@ export const simulateClick = (target: EventTarget, eventParams?: PointerEventIni
export const getVue2Data = (el: any) =>
// eslint-disable-next-line no-underscore-dangle
el.__vue__ ?? el.parentElement.__vue__ ?? el.children[0].__vue__ ?? el.__vueParentComponent
/**
* vue组件并动态注入 props
*
*
* extraOptions: () => import('./Setting.vue').then(m => createComponentWithProps(m.default, { isWidget: false })),
*/
export function createComponentWithProps(component: any, props: Record<string, any>) {
return Vue.extend({
render(h) {
return h(component, {
props,
})
},
})
}

View File

@ -27,5 +27,4 @@ export { default as OptionRadioGroup } from '@/ui/OptionRadioGroup.vue'
export { type RadioItem } from '@/ui/radioItem'
export { default as OptionWidgetLayout } from '@/ui/OptionWidgetLayout.vue'
export { default as RadioGroupItem } from '@/ui/RadioGroupItem.vue'
export { createComponentWithProps } from '@/ui/vue-component-factory'
export { default as MiniToast } from '@/core/toast/MiniToast.vue'

View File

@ -1,18 +0,0 @@
import Vue from 'vue'
/**
* props
*
*
*
* extraOptions: () => import('./Setting.vue').then(m => createComponentWithProps(m.default, { isWidget: false })),
*/
export function createComponentWithProps(component: any, props: Record<string, any>) {
return Vue.extend({
render(h) {
return h(component, {
props,
})
},
})
}