Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (28 sloc) 924 Bytes
title layout
Browser APIs
docs

Usage

Exporting a function in saber-browser.js in the root of your project to extend Saber's browser APIs.

export default context => {
  // Do something
}

The default export is optional, you can use this file to import JavaScript or CSS files if you want.

API

context

The context varies in different renderers, Saber currently only supports Vue.

context.router

The Vue Router instance.

context.setHead

  • Params:
    • head: object function, like the component option head

Set the head option for root Vue instance.

context.setRootComponent

  • Params:
    • component: VueComponentOptions, a Vue component

Wrap your whole app in a Vue component

context.rootOptions

The options for root Vue instance.

It's not recommended to mutate existing properties in rootOptions.

You can’t perform that action at this time.