bwin/coffee-in-vue-templates-loader


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

License: MIT

Language: CoffeeScript

Keywords: coffeescript, vue


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

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

Installation

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

Example usage

Example usage with pug (as intended):

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

Same example with just html:

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

Both would get transpiled to:

<template>
	<div :class="{ active: i === 2 }" @click="fn(item, { something: true })">{{ $t('buttons.ok') }}</div>
</template>

Webpack configuration

With nuxt

For example to use with pug, put the following in nuxt.config.coffee:

[...]
	build:
		extend: (config, ctx) ->
			config.module.rules.push
				test: /\.pug$/
				use: ['coffee-in-vue-templates-loader', 'pug-plain-loader']

Project Statistics

Sourcerank 2
Repository Size 46.9 KB
Stars 1
Forks 0
Watchers 1
Open issues 0
Dependencies 323
Contributors 1
Tags 0
Created
Last updated
Last pushed

Top Contributors See all

Benjamin Winkler

Packages Referencing this Repo

coffee-in-vue-templates-loader
Webpack-loader to use coffeescript in vue templates as attributes or interpolations.
Latest release 0.0.3 - Updated - 1 stars

Something wrong with this page? Make a suggestion

Last synced: 2019-06-12 01:03:23 UTC

Login to resync this repository