简体   繁体   中英

How to install page.js

I want to use page.js in my project. But I think its using some sort of build system so I am not getting a single page.js file that I include in the page and start using

page('/',index)

Any idea, how to use it.

In your terminal:

npm install page

Then in node:

> var page = require('page')
undefined
> page
{ [Function: page]
  callbacks: [],
  base: [Function],
  start: [Function],
  stop: [Function],
  show: [Function],
  replace: [Function],
  dispatch: [Function],
  Context: [Function: Context],
  Route: [Function: Route] }

Is that what you are looking for?

The actual client-side script is called index.js in the root directory of the bundle. Just rename it to page.js and copy it to wherever you're keeping your library scripts.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM