未置顶前效果图:
置顶后的效果图:
代码实现:
new.json
[
{
"id": "G11111","title": "手机","price": 2999},
{
"id": "G22222","title": "平板电脑","price": 1999},
{
"id": "G33333","title": "笔记本电脑","price": 5999},
{
"id": "G44444","title": "树莓派电脑","price": 999},
{
"id": "G55555","title": "超级计算机","price": 9999999}
]
url.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script> <!--引入axios-->
</head>
<body>
<ul class="new_box">
<li class="new_list">