vue-cli4+vue2+element转vite+vue3+js+element-plus报错

项目转换启动,我的原先用的vue.js中的install全局公共方法报错,项目启动页面一直白屏,微信分享插件因为使用了$符号,也一直报错
我想知道在vite搭建的vue项目中如何使用类似install这种全局公共方法

img

官网不是写的很明白吗

install: (app, options) => {
        // app.config.globalProperties.$translate = (key) => {
        //      这里就是你的问题所在了  $translate 就是全局注册的自定义函数
        //     return key.split('.')
        //         .reduce((o, i) => { if (o) return o[i] }, options)
        // }
        //
        // app.provide('i18n', options)
        //
        // app.directive('my-directive', {
        //     mounted (el, binding, vnode, oldVnode) {
        //         // some logic ...
        //     }
        // })
        //
        // app.mixin({
        //     created() {
        //         // some logic ...
        //     }
        // })
      
    }

```