Axios入门

image.png

image.png

image.png

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Document</title>

    <script src="../ajax/axios-0.18.0.js"></script>

    <script src="../ajax/vue.js"></script>

</head>

<body>

    <div id="app">

        <table border="1" cellspacing="0" width="60%">

            <tr>

                <th>编号</th>

                <th>姓名</th>

                <th>用户名</th>

                <th>邮箱</th>

                <th>手机号</th>

                <th>网站</th>

                <th>城市</th>

            </tr>

            <tr align="center" v-for="(user, index) in emps">

                <td>{
  {index + 1}}</td>

                <td>{
  {user.name}}</td>

                <td>{
  {user.username}}</td>

                <td>

                   {
  {user.email}}

                </td>

                <td>{
  {user.phone}}</td>

                <td>

                    {
  {user.website}}

                </td>

  

                <td>

                    {
  {user.address.city}}

                </td>

            </tr>

                </table>

    </div>

</body>

</html>

  
  

<script>

    new Vue({
     

        el:"#app",

        data:{
     

            emps : []

        },

        mounted() {
     

            axios.get("https://jsonplaceholder.typicode.com/users").then(

                result => {
     

                    this.emps = result.data

                }

            )

        },

    })

</script>

相关推荐

  1. axios入门

    2024-01-26 14:10:01       32 阅读
  2. <span style='color:red;'>Axios</span>

    Axios

    2024-01-26 14:10:01      52 阅读
  3. axios

    2024-01-26 14:10:01       55 阅读
  4. Axios

    2024-01-26 14:10:01       45 阅读
  5. <span style='color:red;'>axios</span>

    axios

    2024-01-26 14:10:01      38 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-26 14:10:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-26 14:10:01       100 阅读
  3. 在Django里面运行非项目文件

    2024-01-26 14:10:01       82 阅读
  4. Python语言-面向对象

    2024-01-26 14:10:01       91 阅读

热门阅读

  1. react函数式组件和类组件

    2024-01-26 14:10:01       61 阅读
  2. 自幂数 水仙花数

    2024-01-26 14:10:01       63 阅读
  3. k8s安全机制

    2024-01-26 14:10:01       53 阅读
  4. Python狄拉克δ函数

    2024-01-26 14:10:01       49 阅读
  5. MySQL的数据锁表(data_locks 表)

    2024-01-26 14:10:01       46 阅读
  6. 【重点问题】攻击面发现及管理

    2024-01-26 14:10:01       39 阅读