Skip to content

Commit

Permalink
Ignore prop validation diagnostic when dynamic prop
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyo930021 committed Sep 4, 2020
1 parent e97c88c commit f22f8c7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/src/modes/template/services/vuePropValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ function traverseNodes(nodes: Node[], f: (n: Node) => any) {
}

function generateDiagnostic(n: Node, definedProps: PropInfo[], document: TextDocument): 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(':['))) {
return undefined;
}

const seenProps = n.attributeNames.map(attr => {
return {
name: attr,
Expand Down

0 comments on commit f22f8c7

Please sign in to comment.