当前位置:网站首页>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>
边栏推荐
- Unity skframework framework (XVIII), roamcameracontroller roaming perspective camera control script
- 每日一题:1175.质数排列
- Fundamentals of machine learning (II) -- division of training set and test set
- 研究表明“气味相投”更易成为朋友
- Unity SKFramework框架(十五)、Singleton 单例
- Explanation of 34 common terms on the Internet
- 文件的下载与图片的预览
- 嵌入式软件开发
- [indomitable medal activity] life goes on and writing goes on
- Jerry's watch reads the alarm clock [chapter]
猜你喜欢

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

Operation tutorial: how does easydss convert MP4 on demand files into RTSP video streams?
![[indomitable medal activity] life goes on and writing goes on](/img/c1/54e3f1b37db25af3f1998b39da301b.png)
[indomitable medal activity] life goes on and writing goes on

操作教程:EasyDSS如何将MP4点播文件转化成RTSP视频流?

最近公共祖先LCA的三种求法

伙伴云表格强势升级!Pro版,更非凡!

无向图的桥

Unity SKFramework框架(二十一)、Texture Filter 贴图资源筛选工具

Research shows that "congenial" is more likely to become friends
![[技术发展-22]:网络与通信技术的应用与发展快速概览-2- 通信技术](/img/a7/44609a5acf25021f1fca566c3d8c90.png)
[技术发展-22]:网络与通信技术的应用与发展快速概览-2- 通信技术
随机推荐
能自动更新的万能周报模板,有手就会用!
The second anniversary of the three winged bird: the wings are getting richer and the take-off is just around the corner
Unity SKFramework框架(二十)、VFX Lab 特效库
Embedded software development
Unity SKFramework框架(十六)、Package Manager 開發工具包管理器
Unity skframework framework (XVI), package manager development kit Manager
Security RememberMe原理分析
中文姓名提取(玩具代码——准头太小,权当玩闹)
JS reverse row query data decryption
Unforgettable Ali, 4 skills, 5 hr additional written tests, it's really difficult and sad to walk
SAP MM 因物料有负库存导致MMPV开账期失败问题之对策
Jerry's watch time synchronization [chapter]
(7) Web security | penetration testing | how does network security determine whether CND exists, and how to bypass CND to find the real IP
Unity SKFramework框架(二十一)、Texture Filter 贴图资源筛选工具
Numpy array calculation
Record idea shortcut keys
免费SSL证书知多少?免费SSL证书和收费SSL证书的区别
[error record] cannot open "XXX" because Apple cannot check whether it contains malware
Unity skframework framework (XVII), freecameracontroller God view / free view camera control script
2022 Heilongjiang provincial examination on the writing skills of Application Essays