app.component('article-list', {
    template: `
    <div class="article-list">
        <article v-for="item in list" @click="toDetail(item.id)">
            <section class="s-left" :class="{image:!!item.header_image}">
                <div class="s-title">{{item.title}}</div>
                <div class="s-time">{{item.update_time}}</div>
            </section>
            <section class="s-right" v-if="item.header_image">
                <van-image
                        width="110"
                        height="85"
                        fit="cover"
                        :src="item.header_image"
                ></van-image>
            </section>
        </article>
    </div>
    `,
    data() {
        return {}
    },
    props: {
        list: {
            type: Array,
            default: [],
        },
    },
    methods: {
        toDetail(id) {
            location.href = "/mobile/article/detail.html?id=" + id;
        },
    },
});