ramp4-pcar4 / story-ramp

Storytelling with interactive maps using RAMP
MIT License
4 stars 13 forks source link

Update README.md for plugin usage #368

Closed yileifeng closed 6 months ago

yileifeng commented 1 year ago

Update documentation for how to import and use ramp-storylines package inside a different Vue project. Re-publish to NPM after complete. Not quite fully tested for integration into other projects (marketing site, storylines editor) so could be more info to be added.

Use this template for reference:

Usage:

  1. Install the ramp-storylines package from npm:

    npm install ramp-storylines
  2. Install the plugin in your Vue app:

    import StorylinesViewer from 'ramp-storylines'
    Vue.use(StorylinesViewer);
  3. Import i18n instance from the plugin :

    import { storylinesI18n } from 'ramp-storylines';
    ...either inject it in Vue instance or merge messages with existing i18n instance
  4. Use the components in your Vue templates, here is a demo usage:

    
    <!-- Display the intro slide -->
    <story-intro :config="config.introSlide" />


5. Provide config/schema/demo information