当前位置:网站首页>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>
边栏推荐
- Can automatically update the universal weekly report template, you can use it with your hand!
- 诚邀青年创作者,一起在元宇宙里与投资人、创业者交流人生如何做选择……...
- Jerry's watch gets the default ringtone selection list [article]
- Security RememberMe原理分析
- Unity skframework framework (XVI), package manager development kit Manager
- Should I have a separate interface assembly- Should I have a separate assembly for interfaces?
- Unity skframework framework (XIII), question module
- How to modify the error of easydss on demand service sharing time?
- Research shows that "congenial" is more likely to become friends
- 挥发性有机物TVOC、VOC、VOCS气体检测+解决方案
猜你喜欢
Jerry's watch gets the default ringtone selection list [article]
We sincerely invite young creators to share with investors and entrepreneurs how to make choices in life in the metauniverse
Node.js通过ODBC访问PostgreSQL数据库
操作教程:EasyDSS如何将MP4点播文件转化成RTSP视频流?
Operation tutorial: how does easydss convert MP4 on demand files into RTSP video streams?
2022 Heilongjiang provincial examination on the writing skills of Application Essays
Unity SKFramework框架(二十)、VFX Lab 特效库
Unity SKFramework框架(十四)、Extension 扩展函数
Independent and controllable 3D cloud CAD: crowncad enables innovative design of enterprises
PR usage skills, how to use PR to watermark?
随机推荐
EasyDSS点播服务分享时间出错如何修改?
Node.js通过ODBC访问PostgreSQL数据库
每日一题:1175.质数排列
完全自主可控三维云CAD:CrownCAD便捷的命令搜索,快速定位所需命令具体位置。
运维必备——ELK日志分析系统
Partner cloud form strong upgrade! Pro version, more extraordinary!
Crowncad (crown CAD), the first fully independent 3D CAD platform based on Cloud Architecture in China
Unity SKFramework框架(十五)、Singleton 单例
【笔耕不辍勋章活动】生命不止,写作不息
leetcode621. task scheduler
互联网常见34个术语解释
Unity SKFramework框架(十八)、RoamCameraController 漫游视角相机控制脚本
Redis数据库持久化
Unity SKFramework框架(十七)、FreeCameraController 上帝视角/自由视角相机控制脚本
机器学习基础(二)——训练集和测试集的划分
Gee learning notes 2
免费SSL证书知多少?免费SSL证书和收费SSL证书的区别
Unity skframework framework (XV), singleton singleton
文件的下载与图片的预览
The second anniversary of the three winged bird: the wings are getting richer and the take-off is just around the corner