vue#markRaw JavaScript Examples

The following examples show how to use vue#markRaw. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: app.js    From quasar-app-extension-ssg with MIT License 6 votes vote down vote up
export default async function (createAppFn, quasarUserOptions, ssrContext) {
  // Create the app instance.
  // Here we inject into it the Quasar UI, the router & possibly the store.
  const app = createAppFn(RootComponent);

  <% if (ctx.dev || ctx.debug) { %>
  app.config.performance = true;
  <% } %>

  app.use(Quasar, quasarUserOptions, ssrContext);

  <% if (store) { %>
  const store = typeof createStore === 'function'
    ? await createStore({ ssrContext })
    : createStore;

  <% if (__storePackage === 'vuex') { %>
  // obtain Vuex injection key in case we use TypeScript
  const { storeKey } = await import('app/<%= sourceFiles.store %>');
  <% } else if (__storePackage === 'pinia') { %>
  app.use(store);

  <% if (ssr.manualStoreHydration !== true) { %>
  // prime the store with server-initialized state.
  // the state is determined during SSR and inlined in the page markup.
  if (typeof window !== 'undefined' && ssrIsRunningOnClientPWA !== true && window.__INITIAL_STATE__ !== void 0) {
    store.state.value = window.__INITIAL_STATE__;
    // for security reasons, we'll delete this
    delete window.__INITIAL_STATE__;
  }
  <% } %>
  <% } %>
  <% } %>

  const router = markRaw(
    typeof createRouter === 'function'
      ? await createRouter({ <%= `ssrContext${store ? ',' : ''}` %><%= store ? ' store' : '' %> }