All language subtitles for 014 The setup Attribute_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

In this lecture, we're going to finish our discussion of the Composition API by looking at a syntactic

feature by compiling our project with vite.

We have access to a special attribute to simplify the composition API.

Let's open the app component file.

On the script.

BLOCK Add an attribute called setup.

By adding this attribute code written inside the script block will be wrapped by the setup function.

That means we don't have to export an object, nor do we need to add the setup function.

We can safely remove the export statement.

Do not remove the inner contents of the object.

Next, remove the name components and setup properties.

However, do not remove the inner contents of the setup function.

You may need to format your code after doing so.

Remove the return statements.

Voila.

We're finished.

We do not need to return values.

View will automatically export the variables and functions defined from the block.

Our template will continue to have access to everything.

What about the components and import statements?

If we import a component, it will automatically be registered with the current components.

For example, the app alert component will remain functional from within the templates.

As for the import statements, they'll be moved outside of the setup function.

Behind the scenes view handles the complexities.

This feature simplifies the composition API further.

However, there is one problem in the template.

We're using an expression to output the name.

However, this property does not exist in the script block.

It does exist with the user object.

In an earlier lecture, we converted the reactive object into separate refs to fix this issue.

We must explicitly define a variable at the bottom of the block called the two refs function with the

user object.

The structure of the return value for the name property.

By explicitly defining the variable, it will be returned by the function.

The name property will be accessible from within the templates.

Let's try testing our code by refreshing the page.

Great.

Our component is entirely functional.

We can perform the same actions as before.

For example, we can type in the input or press the buttons.

Everything works.

That wraps up our discussion of the composition API.

I hope you enjoyed it.

In the next section, let's explore some more features of you.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.