Skip to content

Commit

Permalink
Fix #3144
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyo930021 committed Oct 7, 2021
1 parent 0df3ad4 commit cd3b244
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/src/modes/template/services/vuePropValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ function generateDiagnostic(
document: TextDocument,
vueVersion: VueVersion
): Diagnostic | undefined {
// Ignore diagnostic when have `v-bind`, `v-bind:[key]`, `:[key]`
if (n.attributeNames.some(prop => prop === 'v-bind' || prop.startsWith('v-bind:[') || prop.startsWith(':['))) {
// Ignore diagnostic when have `v-bind`, `v-bind:[key]`, `:[key]`, `v-bind.sync`
if (
n.attributeNames.some(
prop => prop === 'v-bind' || prop.startsWith('v-bind:[') || prop.startsWith(':[') || prop.startsWith('v-bind.')
)
) {
return undefined;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<class-child v-bind="{}" />
<class-child v-bind:[bar]="{}" />
<class-child :[bar]="{}" />
<class-child v-bind.sync="foo" />
<class-child v-model="foo" :foo="foo" :bar="1" ear="ear" far="far" name="name" />
</div>
</template>
Expand Down

0 comments on commit cd3b244

Please sign in to comment.