question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Template Interpolation Issue - First letter not recognized in event variable assignment

See original GitHub issue

Info

  • Platform: Win
  • Vetur version: 0.21.0
  • VS Code version: 1.35.0

Problem

When entering a data property into an event, it ignores the first letter and so persistently reports that the property does not exist. This error can be removed by surrounding the statement in curly brackets, but that creates a bigger Vue error. vetur issue

Reproducible Case

Turn Template Interpolation Service on and write the following code:

<template>
	<span @click="eg = true">Test</span>
</template>

<script>
export default {
	data() {
		return {
			eg: false
		}
	}
}
</script>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:14
  • Comments:26 (14 by maintainers)

github_iconTop GitHub Comments

8reactions
chartingercommented, Jan 14, 2020

The problem is related to the configured line endings. Switching VS Code to LF and it works as expected, CRLF results in the error.

7reactions
octrefcommented, Jun 7, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Template literals (Template strings) - JavaScript | MDN
Template literals are literals delimited with backtick (`) characters, allowing for multi-line strings, string interpolation with embedded ...
Read more >
How can I do string interpolation in JavaScript? - Stack Overflow
I would love to be able to refer to variables inside strings, but in javascript you need to use concatenation (or some other...
Read more >
Displaying values with interpolation - Angular
Interpolation refers to embedding expressions into marked up text. By default, interpolation uses the double curly braces {{ and }} as delimiters.
Read more >
Understanding Template Literals in JavaScript - DigitalOcean
Template literals are a new form of making strings… ... Entire expressions can be interpolated, not just variables, such as in this example ......
Read more >
Documentation - Template Literal Types - TypeScript
Generating mapping types which change properties via template literal strings. ... When a union is used in the interpolated position, the type is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found