-
Notifications
You must be signed in to change notification settings - Fork 33
Closed
nuxt-contrib/vue-sfc-transformer
#28Labels
Description
I am using version 1.0.1 of @nuxt/module-builder.
Given this Vue component located in ./src/runtime/components/Foobar.vue:
<template>
<div>
<div>{{ $test('foobar', "Foobar 'test'") }}</div>
<div>{{ $test('foobar', 'Foobar test') }}</div>
<div>{{ $test('foobar', `Foobar ' " ''" test`) }}</div>
</div>
</template>
<script lang="ts" setup>
const $test = (key: string, text: string): string => key
</script>After running nuxt-module-build build, the output in ./dist/runtime/components/Foobar.vue looks like this:
<template>
<div>
<div>{{ $test(\"foobar\", \"Foobar "test"\") }}</div>
<div>{{ $test('foobar', 'Foobar test') }}</div>
<div>{{ $test(\"foobar\", `Foobar " \" ""\" test`) }}</div>
</div>
</template>
<script setup>
const $test = (key, text) => key;
</script>Here the first and the third call to $test produced invalid syntax. It looks like it tries to escape the quotes when it wouldn't be needed, especially in the third example using backticks.
danielroe