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

https://github.com/bwin/coffee-in-vue-templates-loader

Webpack-loader to use coffeescript in vue templates as attributes or interpolations.
https://github.com/bwin/coffee-in-vue-templates-loader

coffeescript vue

Last synced: 3 months ago
JSON representation

Webpack-loader to use coffeescript in vue templates as attributes or interpolations.

Awesome Lists containing this project

README

          

# coffee-in-vue-templates-loader [CIVTL]

| Webpack-loader to use coffeescript in vue templates as attributes or interpolations.

- [Installation](#installation)
- [Example usage](#example-usage)
- [Webpack configuration](#webpack-configuration)
- [With nuxt](#with-nuxt)

## Installation

```sh
yarn add --dev coffee-in-vue-templates-loader
```

## Example usage

### Example usage with `pug` (as intended):
```vue

div(:class="active: i is 2" @click="fn item, something: yes") {{ $t 'buttons.ok' }}

```

### Same example with just html:
```vue

{{ $t 'buttons.ok' }}

```

### Both would get transpiled to:
```vue

{{ $t('buttons.ok') }}

```

## Webpack configuration

### With `nuxt`

For example to use with `pug`, put the following in `nuxt.config.coffee`:
```coffee
[...]
build:
extend: (config, ctx) ->
config.module.rules.push
test: /\.pug$/
use: ['coffee-in-vue-templates-loader', 'pug-plain-loader']
```