Skip to content

Commit

Permalink
fix: don't report property does not exist error for data-* and `ari…
Browse files Browse the repository at this point in the history
…a-*`
  • Loading branch information
johnsoncodehk committed Jun 4, 2022
1 parent 9d6f5a8 commit ba2835f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/vue-code-gen/src/generators/template.ts
Expand Up @@ -898,7 +898,9 @@ export function generate(
propName_1 = propName_1.substring(1);
}

const propName_2 = !isStatic ? propName_1 : hyphenate(propName_1) === propName_1 ? camelize(propName_1) : propName_1;
const propName_2 = !isStatic ? propName_1
: hyphenate(propName_1) === propName_1 && !propName_1.startsWith('data-') && !propName_1.startsWith('aria-') ? camelize(propName_1)
: propName_1;

if (forRemainStyleOrClass && propName_2 !== 'style' && propName_2 !== 'class')
continue;
Expand Down Expand Up @@ -1041,7 +1043,7 @@ export function generate(
prop.type === CompilerDOM.NodeTypes.ATTRIBUTE
) {

const propName = hyphenate(prop.name) === prop.name ? camelize(prop.name) : prop.name;
const propName = hyphenate(prop.name) === prop.name && !prop.name.startsWith('data-') && !prop.name.startsWith('aria-') ? camelize(prop.name) : prop.name;
const propName2 = prop.name;

if (forRemainStyleOrClass && propName !== 'style' && propName !== 'class')
Expand Down

0 comments on commit ba2835f

Please sign in to comment.