Vue framework study notes - binding class style and binding style style


Preface summary

I am only making personal study records. Please forgive me if there are any mistakes.

Main learning links:Shang Silicon Valley Vue2.0+Vue3.0 full set of tutorials丨vuejs from entry to master


Three binding methods of class style (picture from reference link)

Most of them use the object writing method for style binding. The reason why it is written like this is for convenience of use and is a filtered writing method.

html code:
Insert image description here
Writing method in data:
Insert image description here
Style object, each style attribute must exist before writing.
:class is the abbreviation of v-bind:class, which changes static attributes into dynamic attributes.

style style (inline form)

html code:
Insert image description here
Writing method in data:
Insert image description here
Style object, each style attribute must exist before writing.
:style is the abbreviation of v-bind:style, which changes static attributes into dynamic attributes.

Summarize

Insert image description here


This is the end.

Guess you like

Origin blog.csdn.net/Aer_7z/article/details/134657001