Cem Kaan
Cem Kaan

Reputation: 2226

How to add dollar signs in Code Snippets of Visual Studio Code?

$ (dollar signs) are removed from Snippets in Visual Studio Code

How to disable placeholders?

My vue-html.json file snippet

"body": ["<ActivityIndicator  v-if=\"$apollo.loading\" />"]

does not add $ and produces

<ActivityIndicator v-if="apollo.loading"  />

but instead it should produce

<ActivityIndicator v-if="$apollo.loading" />

Upvotes: 0

Views: 1097

Answers (2)

tHeSiD
tHeSiD

Reputation: 5333

"body": ["<ActivityIndicator v-if=\"\\$apollo.loading\" />"]

You need to escape the $ symbol individually too

Upvotes: 0

hotpink
hotpink

Reputation: 3226

  "description": {
    "prefix": "trigger",
    "body": [
      "<ActivityIndicator v-if=\"\\$apollo.loading\" />"
    ],
    "description": "description"
  }

In JSON the backslash itself needs to be encoded with \, which is why you need \\

Upvotes: 1

Related Questions