cc-ui-plus
Version:
16 lines (14 loc) • 323 B
JavaScript
function withInstall(c, name) {
c.install = (app) => {
app.component(name, c)
}
return c
}
const withInstallFunction = (fn, name) => {
fn.install = (app) => {
fn._context = app._context
app.config.globalProperties[name] = fn
}
return fn
}
export { withInstall, withInstallFunction }