Skip to content

Commit

Permalink
fix(code-gen): support attribute binding syntax :<name>.attr (#1047)
Browse files Browse the repository at this point in the history
Co-authored-by: anh.pham <anh.pham@cm.com>
Co-authored-by: johnsoncodehk <johnsoncodehk@gmail.com>
  • Loading branch information
3 people committed Mar 15, 2022
1 parent 5a6f519 commit 02c28eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/vue-code-gen/src/generators/template.ts
Expand Up @@ -393,8 +393,8 @@ export function generate(
? prop.arg.content
: prop.arg.loc.source

if (prop.modifiers.some(m => m === 'prop')) {
propName = propName.substr(1);
if (prop.modifiers.some(m => m === 'prop' || m === 'attr')) {
propName = propName.substring(1);
}

if (prop.name === 'bind' || prop.name === 'model') {
Expand Down Expand Up @@ -858,8 +858,8 @@ export function generate(
: prop.arg.loc.source
: getModelValuePropName(node, isVue2);

if (prop.modifiers.some(m => m === 'prop')) {
propName_1 = propName_1.substr(1);
if (prop.modifiers.some(m => m === 'prop' || m === 'attr')) {
propName_1 = propName_1.substring(1);
}

const propName_2 = !isStatic ? propName_1 : hyphenate(propName_1) === propName_1 ? camelize(propName_1) : propName_1;
Expand Down

0 comments on commit 02c28eb

Please sign in to comment.