An open API service indexing awesome lists of open source software.

https://github.com/seregpie/vuetexttemplate

Replaces the tokens inside a text template with the scoped slots.
https://github.com/seregpie/vuetexttemplate

component scope slot template text token vue

Last synced: about 1 month ago
JSON representation

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

Awesome Lists containing this project

README

          

# VueTextTemplate

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

## dependencies

- [renderTemplate](https://github.com/SeregPie/renderTemplate)

## setup

### npm

```shell
npm i vuetexttemplate
```

### ES module

Register the component globally.

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

Vue.component(VueTextTemplate.name, VueTextTemplate);
```

*or*

Register the component in the scope of another component.

```javascript
import VueTextTemplate from 'vuetexttemplate';

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

### browser

```html

```

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

## usage

```html

```

```javascript
// ...
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` | `''` |

---

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

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