This package has been deprecated

Author message:

WARNING: This project has been deprecated.

vuetexttemplate

19.0.0 • Public • Published

VueTextTemplate

Replaces the tokens inside a text template with the scoped slots.

dependencies

setup

npm

npm i vuetexttemplate

ES module

Register the component globally.

import Vue from 'vue';
import VueTextTemplate from 'vuetexttemplate';

Vue.component(VueTextTemplate.name, VueTextTemplate);

or

Register the component in the scope of another component.

import VueTextTemplate from 'vuetexttemplate';

export default {
  components: {
    [VueTextTemplate.name]: VueTextTemplate,
  },
  // ...
};

browser

<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/@seregpie/render-template"></script>
<script src="https://unpkg.com/vuetexttemplate"></script>

If Vue is detected, the component will be registered automatically.

usage

<vue-text-template :template="text">
  <my-icon
    v-slot="index"
    :color="items[index].color"
    :type="items[index].icon"
  />
</vue-text-template>
// ...
data: {
  text: 'Choose between {{ 0 }}, {{ 1 }} and {{ 2 }}.',
  items: [
    {icon: 'train', color: 'red'},
    {icon: 'tram', color: 'green'},
    {icon: 'subway', color: 'blue'},
  ],
},

properties

property type default
regex *
tag String 'div'
template String ''

import renderTemplate from '@seregpie/render-template';

let regex = function() {
  return renderTemplate.regex;
};

Package Sidebar

Install

npm i vuetexttemplate

Weekly Downloads

0

Version

19.0.0

License

MIT

Unpacked Size

4.28 kB

Total Files

4

Last publish

Collaborators

  • npm