区块链17-区块链去中心化应用开发10-DAPP实战-页面编写

本文介绍了如何通过解决网络请求错误来成功下载Pet Shop应用,并详细记录了使用VSCode进行资源复制及修改index.html的过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

根据https://www.trufflesuite.com/boxes/pet-shop

安装一个,再从中复制资源

下载unbox时

RequestError: Error: getaddrinfo ENOENT raw.githubusercontent.com

 

解决

https://blog.youkuaiyun.com/zxs9999/article/details/107079329?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522160595597219725225048378%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=160595597219725225048378&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~baidu_landing_v2~default-1-107079329.pc_first_rank_v2_rank_v28&utm_term=RequestError%3A+Error%3A+getaddrin&spm=1018.2118.3001.4449

我既科学上网,又改host文件,然后试的,成功下载了。

 

再复制

vscode终端,打开pet_shop cp -r ../../pet_shop_2/src/css  .(有一个点)

vscode终端,打开pet_shop cp -r ../../pet_shop_2/src/fonts .

vscode终端,打开pet_shop cp -r ../../pet_shop_2/src/images .

vscode终端,打开pet_shop cp -r ../../pet_shop_2/src/pets.json .

vscode终端,打开pet_shop cp -r ../../pet_shop_2/src/js .

 

它app.js它只写了一个框架,保留。

 

index改成

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>Pete's Pet Shop</title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">


</head>
<body>
    <div class="container">
        <h1 class="text-center">Pete's Pet Shop</h1>

        <div id="petsRow" class="row">
            
        </div>
    </div>

    <div id="petTemplate" style="display: none">
        <div class="col-sm-6 col-md-4 col-lg-3">
          <div class="panel panel-default panel-pet">
            <div class="panel-heading">
              <h3 class="panel-title">Scrappy</h3>
            </div>
            <div class="panel-body">
              <img alt="140x140" data-src="holder.js/140x140" class="img-rounded img-center" style="width: 100%;" src="https://animalso.com/wp-content/uploads/2017/01/Golden-Retriever_6.jpg" data-holder-rendered="true">
              <br/><br/>
              <strong>Breed</strong>: <span class="pet-breed">Golden Retriever</span><br/>
              <strong>Age</strong>: <span class="pet-age">3</span><br/>
              <strong>Location</strong>: <span class="pet-location">Warren, MI</span><br/><br/>
              <button class="btn btn-default btn-adopt" type="button" data-id="0">Adopt</button>
            </div>
          </div>
        </div>
      </div>
    </div>
</body>
</html>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

百战成王

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值