当前位置:网站首页>Astro learning notes
Astro learning notes
2022-07-02 13:30:00 【Code husky】
---
// stay (`---`) Within the scope of JS or TS The code only runs on the server !
// Insert a topic here A problem of component import What does that mean If we put TestOne The introduction code of
// Put it into the logic code, such as console.log(' Code update ') below It will report an error that it was not found TestOne Definition
import TestOne from './../components/TestOne.astro'
import TestTwo from './../components/TestTwo.astro'
import TestThree from './../components/TestThree.astro'
import TestFour from './../components/TestFour.astro'
// Another way to introduce picture resources The routine is img Label plus direct src It's not much different Just introduce the link first Avoid some path problems
import mySrc from './../../public/images/one.png'
// Data acquisition fetch
const res = await fetch('https://www.fastmock.site/mock/accdb6b2986294c13443aed4119f0055/api/menu/list');
const data = await res.json();
console.log(data);
console.log(' Code update ')
const title = " My first one axtro project "
const items = ['d','m','h','s','q']
const attrName = "dmhsq a"
const firstName = 'dmhsq'
---
<html>
<meta charset="UTF-8" />
<body>
<img src={mySrc} />
<h1 data-name={attrName}>{title}</h1>
<ul>
{items.map((item)=>(
<li>{item}</li>
))}
</ul>
<TestOne name={firstName} />
<TestTwo>
<!-- The component uses the parent property -->
<TestOne name={firstName} />
</TestTwo>
<TestThree>
<h1 slot="title"> shock , Hot water can be drunk </h1>
<!-- As you can see, there is no slot inserted here In fact, it is the function of the second slot -->
<!-- You can try to remove the slot with undefined name There are no bound slots below i Will disappear You'll find that Below h4 label Actually in TestFour after p front Not the end This is also certified Inserted slot -->
<h3>--- From a website </h3>
<TestFour>
</TestFour>
<p slot="content"> Recently, a man found that hot water can be drunk !</p>
<p slot="tranform">what fuck! hot water can be drinked wc!</p>
<h4>ss</h4>
</TestThree>
</body>
</html>
<style lang='css||scss'> body{
h1{
color:orange; } } </style>
<script> // Enter here JS The code runs entirely on the browser . console.log('See me in the devTools') </script>
边栏推荐
- Web基础
- [Unity]使用GB2312,打包后程序不正常解决方案
- Ruby: how to copy variables without pointing to the same object- Ruby: how can I copy a variable without pointing to the same object?
- Unity SKFramework框架(十七)、FreeCameraController 上帝视角/自由视角相机控制脚本
- [OpenGL] notes 29. Advanced lighting (specular highlights)
- 屠榜多目标跟踪!BoT-SORT:稳健的关联多行人跟踪
- Mysql常用命令详细大全
- What are the classifications of SSL certificates? How to choose the appropriate SSL certificate?
- Jerry's watch delete alarm clock [chapter]
- Jerry's weather code table [chapter]
猜你喜欢

Unity SKFramework框架(十六)、Package Manager 開發工具包管理器

Independent and controllable 3D cloud CAD: crowncad enables innovative design of enterprises

Unforgettable Ali, 4 skills, 5 hr additional written tests, it's really difficult and sad to walk

Partner cloud form strong upgrade! Pro version, more extraordinary!

中文姓名提取(玩具代码——准头太小,权当玩闹)

Ali on three sides, it's really difficult to successfully get the offer rated P7

Bridge of undirected graph

Ali was killed by two programming problems at the beginning, pushed inward again, and finally landed (he has taken an electronic offer)

基于ssm+jsp框架实现的学生选课信息管理系统【源码+数据库】

【蓝桥杯选拔赛真题43】Scratch航天飞行 少儿编程scratch蓝桥杯选拔赛真题讲解
随机推荐
Jerry's watch modifies the alarm clock [chapter]
Pocket Raider comments
Gee learning notes 2
Error function ERF
完全自主可控三维云CAD:CrownCAD便捷的命令搜索,快速定位所需命令具体位置。
MySQL: Invalid GIS data provided to function st_ geometryfromtext
Everyone wants to eat a broken buffet. It's almost cold
JS reverse row query data decryption
Jerry's weather direction coding table [chapter]
Node.js通过ODBC访问PostgreSQL数据库
Unity skframework framework (XX), VFX lab special effects library
Chinese name extraction (toy code - accurate head is too small, right to play)
D如何检查null
The second anniversary of the three winged bird: the wings are getting richer and the take-off is just around the corner
Unity skframework framework (XIX), POI points of interest / information points
When tidb meets Flink: tidb efficiently enters the lake "new play" | tilaker team interview
Clean up system cache and free memory under Linux
JS generates 4-digit verification code
numpy数组计算
基于ssm+jsp框架实现的学生选课信息管理系统【源码+数据库】