How to use the @vuepress/core/lib/client/app.js.createApp function in @vuepress/core

To help you get started, we’ve selected a few @vuepress/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appcelerator / docs-devkit / packages / vuepress / vuepress-plugin-apidocs / lib / webpack / clientEntry.js View on Github external
/* global VUEPRESS_VERSION, LAST_COMMIT_HASH*/

import { createApp } from '@vuepress/core/lib/client/app.js'
import { sync } from 'vuex-router-sync'

const { app, router } = createApp(false /* isServer */)

const store = app.$options.store
if (window.__INITIAL_STATE__) {
  store.replaceState(window.__INITIAL_STATE__)
}
sync(store, router)

window.__VUEPRESS_VERSION__ = {
  version: VUEPRESS_VERSION,
  hash: LAST_COMMIT_HASH
}

router.onReady(() => {
  if (!window.__INITIAL_STATE__) {
    fetchMetadata(router.currentRoute)
  }