Skip to content

Commit

Permalink
feat(vue): add v-bind:class support
Browse files Browse the repository at this point in the history
  • Loading branch information
luckasRanarison committed Aug 3, 2024
1 parent 7e280a5 commit f96222d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions queries/vue/class.scm
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
; inherits: html

(directive_attribute
(directive_name) @directive.name
(#eq? @directive.name "v-bind")
(directive_value) @directive.value
(#eq? @directive.value "class")
(quoted_attribute_value
(attribute_value) @tailwind))
2 changes: 1 addition & 1 deletion tests/queries/vue/test.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="bg-neutral-700">
<div v-bind:class="{ container: true }">
<div class="font-semibold text-blue-400">Test</div>
<ul>
<li v-for="item in items" class="text-white">{{ item }}</li>
Expand Down
2 changes: 1 addition & 1 deletion tests/queries/vue_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require("tests.queries.runner").test({
provider = "treesitter",
file = "tests/queries/vue/test.vue",
ranges = {
{ 1, 14, 1, 28 },
{ 1, 21, 1, 40 },
{ 2, 16, 2, 43 },
{ 4, 39, 4, 49 },
},
Expand Down

0 comments on commit f96222d

Please sign in to comment.