当前位置:网站首页>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框架(十九)、POI 兴趣点/信息点
- Record idea shortcut keys
- Uniapp develops wechat applet Tencent map function and generates sig signature of location cloud
- Numpy array calculation
- I did it with two lines of code. As a result, my sister had a more ingenious way
- PR usage skills, how to use PR to watermark?
- Unity skframework framework (XVI), package manager development kit Manager
- Achievements in science and Technology (27)
- Jerry's weather direction coding table [chapter]
- What are the classifications of SSL certificates? How to choose the appropriate SSL certificate?
猜你喜欢
Jerry's watch time synchronization [chapter]
OpenApi-Generator:简化RESTful API开发流程
Independent and controllable 3D cloud CAD: crowncad enables innovative design of enterprises
【笔耕不辍勋章活动】生命不止,写作不息
PR usage skills, how to use PR to watermark?
Gee learning notes 2
2022 Heilongjiang provincial examination on the writing skills of Application Essays
操作教程:EasyDSS如何将MP4点播文件转化成RTSP视频流?
解答:EasyDSS视频点播时音频是否可以设置为默认开启?
国内首款、完全自主、基于云架构的三维CAD平台——CrownCAD(皇冠CAD)
随机推荐
Unity SKFramework框架(十二)、Score 计分模块
挥发性有机物TVOC、VOC、VOCS气体检测+解决方案
Unity SKFramework框架(十七)、FreeCameraController 上帝视角/自由视角相机控制脚本
Jerry's watch ringtone audition [article]
Unity SKFramework框架(十八)、RoamCameraController 漫游视角相机控制脚本
ADB basic commands
记忆函数的性能优化
Lucky numbers in the [leetcode daily question] matrix
Unity SKFramework框架(十九)、POI 兴趣点/信息点
Unity skframework Framework (XVI), package manager Development Kit Manager
mac(macos Monterey12.2 m1) 个人使用php开发
Jerry's watch stops ringing [article]
Jerry's weather code table [chapter]
Principle analysis of security rememberme
I did it with two lines of code. As a result, my sister had a more ingenious way
When tidb meets Flink: tidb efficiently enters the lake "new play" | tilaker team interview
Fundamentals of machine learning (II) -- division of training set and test set
de4000h存储安装配置
SSL证书的分类有哪些?如何选择合适的SSL证书?
leetcode621. 任务调度器