vue-inline

Inline anything in your Vue component.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
vue-inline
321.0.16 years ago6 years agoMinified + gzip package size for vue-inline in KB

Readme

vue-inline NPM version NPM downloads Build Status
Inline anything in your Vue component, like string / component / images et al

Install

$ npm install --save vue-inline

Usage

Register the component globally:
import Inline from 'vue-inline'

Vue.use(Inline, {
  data: {
    // inline a string
    foo: 'inlined foo',
    // or an svg image with svg-inline-loader or file-loader
    bar: require('/path/to/bar.svg')
  }
})

Inline it in your component:
<template>
  <!-- render a srring -->
  <inline name="foo"></inline>
  <!-- render an image -->
  <inline name="bar"></inline>
</template>

Or register the inline component locally:
import {makeComponent} from 'vue-inline'

const Inline = makeComponent(data)
// register `Inline` in your component

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT © EGOIST