vue-inline

Inline anything in your Vue component.
12,240 3
Install
npm install vue-inline
Latest Version:1.0.1
Vue:2
License:MIT
Last Updated:Jun 26, 2022
Links: GitHub  ·  npm
Maintainer: rem

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

Related Packages

vue-inline-svg

Replace SVG images with inline SVG element

4,535,739 188
vue-cli-plugin-svg

Super simple svg loading module for Vue.js

30,762
vue-cli-plugin-svg-vue3

Super simple svg loading module for Vue.js

13,310
vue-svg-inline-plugin

Vue plugin for inline replacement of SVG images with actual content of SVG files...

116,816 32

Version History

Version Released Vue License
1.0.1 ^2.0.3 MIT
1.0.0 ^2.0.3 MIT