vue component withInstall - TOMMYHU - 专注互联网开发及运营技术,提供相关资料及软件下载,奇趣网络时事评论!
Dec 16

vue component withInstall 不指定

tommyhu , 15:26 , 软件分析与设计 , 评论(0) , 引用(0) , 阅读(114) , Via 本站原创 | |

import type { App, Plugin } from 'vue';
export const withInstall = <T>(component: T, alias?: string) => {
  const comp = component as any;
  comp.install = (app: App) => {
    app.component(comp.name || comp.displayName, component);
    if (alias) {
      app.config.globalProperties[alias] = component;
    }
  };
  return component as T & Plugin;
};




import { withInstall } from '/@/utils';
import appLogo from './src/AppLogo.vue';
export const AppLogo = withInstall(appLogo);
  • 中查看更多“vue component withInstall ”相关内容
  • 中查看更多“vue component withInstall ”相关内容
  • 中查看更多“vue component withInstall ”相关内容
  • 中查看更多“vue component withInstall ”相关内容
  • 在此发表你对本文的看法:

    您的称呼(例如:乔布斯、tommyhu 等)

    emotemotemotemotemotemotemotemotemotemotemotemotemotemotemotemot