找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 60|回复: 0

QuickTVUI如何使用自定义字体?

[复制链接]

14

主题

3

回帖

82

积分

注册会员

积分
82
发表于 2026-3-15 20:19:47 | 显示全部楼层 |阅读模式
安装插件
  1. 在App.vue中onESCreate方法
  2. // 等待TextV2Component插件安装完成后再进入页面
  3.       return new Promise<void>((resolve) => {
  4.         // 注册TextV2Component组件用于自定义字体
  5.         const pluginInfo: ESPluginInfo = {
  6.           pkg: 'eskit.plugin.textv2',
  7.         }

  8.         // 创建插件安装监听器
  9.         const installListener: ESPluginListener = {
  10.           onPluginInstallSuccess(pkg: string, status: number, msg: string) {
  11.             console.log(`TextV2Component插件安装成功: ${pkg}, status: ${status}, msg: ${msg}`)
  12.             registerTextV2Component(app)
  13.             resolve()
  14.           },
  15.           onPluginInstallProgress(pkg: string, status: number, current: number, total: number) {
  16.             console.log(`TextV2Component插件安装进度: ${pkg}, 进度: ${current}/${total}`)
  17.           },
  18.           onPluginInstallError(pkg: string, status: number, msg: string) {
  19.             console.error(`TextV2Component插件安装失败: ${pkg}, status: ${status}, msg: ${msg}`)
  20.             // 即使安装失败也继续,避免页面卡死
  21.             registerTextV2Component(app)
  22.             resolve()
  23.           }
  24.         }

  25.         plugin.addListener(pluginInfo, installListener)
  26.         plugin.installPlugin(pluginInfo)
  27.       }).then(() => {
  28.         // 插件安装完成后初始化请求管理器
  29.         return Promise.resolve()
  30.       })
复制代码


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|QuickTVUI论坛

GMT+8, 2026-5-1 00:32 , Processed in 0.110999 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表