mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Use type Component as vue component in src/components/types.ts
This commit is contained in:
parent
0d381c3f3a
commit
8f4f393c87
@ -1,3 +1,4 @@
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
import type { OptionsOfMetadata } from '@/components/define'
|
||||
import { defineComponentMetadata, defineOptionsMetadata } from '@/components/define'
|
||||
import type { LaunchBarActionProvider } from '@/components/launch-bar/launch-bar-action'
|
||||
@ -102,7 +103,7 @@ export const component = defineComponentMetadata({
|
||||
// const { addImportantStyle } = await import('@/core/style')
|
||||
// addImportantStyle(style, styleID)
|
||||
},
|
||||
extraOptions: () => import('./settings/ExtraOptions.vue').then(m => m.default),
|
||||
extraOptions: defineAsyncComponent(() => import('./settings/ExtraOptions.vue')),
|
||||
plugin: {
|
||||
displayName: '自定义顶栏 - 功能扩展',
|
||||
setup: ({ addData }) => {
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
import {
|
||||
defineComponentMetadata,
|
||||
defineOptionsMetadata,
|
||||
@ -80,7 +81,7 @@ export const component = defineComponentMetadata({
|
||||
name,
|
||||
entry,
|
||||
// reload: entry,
|
||||
extraOptions: () => import('./Settings.vue').then(m => m.default),
|
||||
extraOptions: defineAsyncComponent(() => import('./Settings.vue')),
|
||||
options: optionsMetadata,
|
||||
displayName: '屏蔽黑名单up主',
|
||||
tags: [componentsTags.utils],
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
import type { OptionsOfMetadata } from '@/components/define'
|
||||
import { defineComponentMetadata, defineOptionsMetadata } from '@/components/define'
|
||||
import type { LaunchBarActionProvider } from '@/components/launch-bar/launch-bar-action'
|
||||
@ -75,7 +76,7 @@ export const component = defineComponentMetadata({
|
||||
description: {
|
||||
'zh-CN': '为脚本的功能和 b 站的功能启用键盘快捷键支持, 快捷键列表可在`快捷键设置`中查看和配置.',
|
||||
},
|
||||
extraOptions: () => import('./settings/ExtraOptions.vue').then(m => m.default),
|
||||
extraOptions: defineAsyncComponent(() => import('./settings/ExtraOptions.vue')),
|
||||
options,
|
||||
plugin: {
|
||||
displayName: '快捷键扩展 - 搜索支持',
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
import { defineComponentMetadata } from '@/components/define'
|
||||
import { select } from '@/core/spin-query'
|
||||
import {
|
||||
@ -152,7 +153,7 @@ export const component = defineComponentMetadata({
|
||||
tags: [componentsTags.video],
|
||||
urlInclude: allVideoUrls,
|
||||
description: { 'zh-CN': desc },
|
||||
extraOptions: () => import('./Options.vue').then(m => m.default),
|
||||
extraOptions: defineAsyncComponent(() => import('./Options.vue')),
|
||||
options: {
|
||||
locations: {
|
||||
defaultValue: lodash.mapValues(pageTypeInfos, () => 0),
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
import type { OptionsOfMetadata } from '@/components/define'
|
||||
import { defineComponentMetadata, defineOptionsMetadata } from '@/components/define'
|
||||
import type { ComponentEntry } from '@/components/types'
|
||||
@ -90,7 +91,7 @@ export const component = defineComponentMetadata({
|
||||
},
|
||||
tags: [componentsTags.utils],
|
||||
options: optionsMetadata,
|
||||
extraOptions: () => import('./ExtraOptions.vue').then(m => m.default),
|
||||
extraOptions: defineAsyncComponent(() => import('./ExtraOptions.vue')),
|
||||
entry,
|
||||
plugin: {
|
||||
displayName: '自动更新器 - 功能扩展',
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import type { Component } from 'vue'
|
||||
import type { Widget } from '@/components/widget'
|
||||
import type { Executable, I18nDescription, TestPattern, ImportedVueComponent } from '@/core/common-types'
|
||||
import type { Executable, I18nDescription, TestPattern } from '@/core/common-types'
|
||||
import type { CoreApis } from '@/core/core-apis'
|
||||
import type { ComponentSettings } from '@/core/settings'
|
||||
import type { PluginMinimalData } from '@/plugins/plugin'
|
||||
@ -183,8 +184,8 @@ export interface FunctionalMetadata<O extends UnknownOptions = UnknownOptions> {
|
||||
unload?: Executable
|
||||
/** 插件化数据定义 */
|
||||
plugin?: Optional<PluginMinimalData, 'name'>
|
||||
/** 额外想要展示在设置里的选项 UI */
|
||||
extraOptions?: () => Promise<ImportedVueComponent>
|
||||
/** 额外想要展示在设置里的选项 UI,创建实例时有传入属性 'component-data': ComponentMetadata */
|
||||
extraOptions?: Component
|
||||
/** 设置匹配的URL, 不匹配则不运行此组件 */
|
||||
urlInclude?: TestPattern
|
||||
/** 设置不匹配的URL, 不匹配则不运行此组件, 优先级高于`urlInclude` */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user