javascript - LitElement Dot with HTML elements attributeproperty - Stack Overflow

I am learning web ponents using Polymer. I am a beginner in web development.How can I understand what

I am learning web ponents using Polymer. I am a beginner in web development.

How can I understand what does dot notation means in .checked attributes or property of HTML element?

<input id="state" type="radio" name=${this.group} .checked=${this.checked} />

I am learning web ponents using Polymer. I am a beginner in web development.

How can I understand what does dot notation means in .checked attributes or property of HTML element?

<input id="state" type="radio" name=${this.group} .checked=${this.checked} />
Share Improve this question edited Nov 12, 2020 at 3:32 Penny Liu 17.6k5 gold badges86 silver badges108 bronze badges asked Apr 28, 2020 at 21:47 user2914606user2914606 711 silver badge2 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 12

Overall the binding type consists of these character prefixes: .prop, ?optional and @event.

html`<input 
    id="state" 
    type="radio" 
    name=${this.group} 
    @change=${onChange}
    ?required=${required}
    .checked=${this.checked} />`

You can insert JavaScript expressions as placeholders for HTML text content, attributes, Boolean attributes, properties, and event handlers.

  • Text content: <p>${...}</p>
  • Attribute: <p id="${...}"></p>
  • Boolean attribute: ?disabled="${...}"
  • Property: .value="${...}"
  • Event handler: @event="${...}"

lit-element documentation

Live Demo

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743777281a4505461.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信