vue.js图片怎么渲染


当前第2页 返回上一页

本地美食

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

<template>

    <div>

        <h1>美食</h1>

        <table border="1">

            <tr>

                <td>美食</td>

                <td>美食图片</td>

                <td>美食价格</td>

            </tr>

            <tr  v-for="i in footlist">

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

                <td><img :src="i.img" height="100" width="100"></td> // 渲染本地图片

                <td>{{i.price}}</td>

            </tr>

        </table>

    </div>

</template>

<script>

    export default {

        name: "foot",

        data: function () {

            return {

                footlist: []  //初始化列表

            }

        },

        mounted() {

            var aa = this.$route.params.id;  //获取上个页面带过来的参数

            this.axios({

            url: '/api/app/foot/'//api 是跨越时设置的 app是路由分发 foot是后端的接口

            data: {aa:aa},   //向后端传递参数

            method: 'post'  //post方式

        }).then((res) => {

            if (res.data.code == 200) {  // code == 200时

                this.footlist = res.data.message; // 初始化赋值

                console.log(res)

            }

        })

        }

    }

</script>

<style scoped>

</style>

相关免费学习推荐:javascript(视频)

以上就是vue.js图片怎么渲染的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

vue.js特性是什么?

vue.js如何阻止事件冒泡

vue.js中v-for列表渲染指令的使用(代码示例)

关于vue使用验证器: veevalidate3

vue.js中使用无状态组件的方法介绍

vue.js如何带参数跳转

vue 的 render 方法中 h 是什么?

深入研究vue cli3

vue.js图片怎么渲染

使用vue.js需要注意什么

更多相关阅读请进入《vue.js》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...