<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>实战</title>
</head>
<body>
    <div id="app">
        <div v-for="xw in xinwens">
            <a :href="'xinwen_xiangqing.html?id='+xw.myid + '&mc='+xw.mybiaoti" class="tongzhi_lianjie">
                <img src="img/news.png" alt="新闻" class="tongzhi_zuo">
                <p class="tongzhi_neirong">{{xw.mybiaoti}}</p>
                <img src="img/right.png" alt="新闻标题" class="tongzhi_you">
            </a>
        </div>
    </div>

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

    <script>

        let vm = new Vue({
            el:'#app',
            data:{
                xinwens:[] //新闻列表
            },
            methods:{
                getXinWens:function () {

                    axios.get('http://phpshop.yaoyiwangluo.com/wx_news_list.php',{
                        params:{
                            cs_shuliang:3,
                            cs_lxid:11
                        },
                    })
                        .then(function (response) {
                            this.xinwens = response.data;
                        })
                        .catch(function (error) {
                            console.log(error);
                        });
                }
            },
            mounted:function () {
                this.getXinWens();
            }
        })
    </script>
</body>
</html>