UNPKG

@opentiny/vue-renderless

Version:

An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.

21 lines (20 loc) 562 B
import "../chunk-G2ADBYYC.js"; const init = ({ service, state }) => () => { const { getUserInfo } = service; getUserInfo().then((user) => { state.userName = user.userCN; }); }; const initService = ({ props, service }) => { const { base = {} } = service || {}; const getUserInfoNoop = () => Promise.reject( new Error("[TINY Error][LogonUser] Prop getUserInfo is mandatory when the framework service is not used") ); return { getUserInfo: props.getUserInfo || base.getUserInfo || getUserInfoNoop }; }; export { init, initService };