Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to write html component

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Most people do not understand the knowledge of this article "how to write html components", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to write html components" article.

1.HTML semantics

Semantic HTML code

two。 Label

Html tags fall into the following categories:

All elements with start and end tags must be marked with a start and end tag, and some elements that allow omission of the start tag or bundle tag must also be written.

Self-closing label do not add the end tag

The name of the custom tag must contain a dash (-), and both are correct names, and the and are incorrect. This limitation allows HTML parsers to distinguish between standard elements and custom elements

Custom tags must be marked with a start label and a closing label

Minimize the number of labels

3. Code nesting

Block elements can contain inline elements or some block elements, but inline elements cannot contain block elements. They can only contain other inline elements.

Headings and paragraphs cannot contain blocks, such as H2, h3, h4, h5, h6, h7, p, dt

Block and inline cannot be juxtaposed, block-level elements and block-level elements are juxtaposed, embedded elements and embedded elements are juxtaposed.

Some tags are fixed nesting rules, such as ul containing li, ol containing li, dl containing dt and dd, and so on.

4. Indent

Unify two space indents

5. Element attribute

Recommend

Not recommended

6. Flexible use of pseudo classes

7. Annotation specification (using the koroFileHeader plug-in)

Single-line comment

Generally used for simple descriptions, such as some state descriptions, attribute descriptions, etc.

There is a space character before and after the comment content, and the comment is on top of the code to be commented, with a separate line

...

Module comment

One space character before and after the comment content

Indicates the start of the module

Indicates the end of the module, separated by one line between the module and the module

Module comments internally nested module comments

Single file component

1. Naming convention

File naming Convention (my-file)

Single file component naming (my-component)

Common component naming (pk-component)

Naming conventions for components in templates

two。 The writing order of a single document

Top-level element order

...

Component configuration item order

VUE component development specification. PNG

3. Component specification

Event name naming the event name thrown by the child component to the parent component: unified "on- event name", eg:on-click-right

During the development of a code file, no more than 1000 lines are allowed for a single file. For particularly complex functions, no more than 1000 lines are allowed.

Common components need to be written with a description of the component and the parameters of the props (using the koroFileHeader plug-in)

Props: {

Start: {

Type: Number

Default: 0

}

End: {

Type: Number

Required: true

}

Decimals: {

Type: Number

Default: 0

}

}

The above is about the content of this article on "how to write html components". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report