palaceGrid.vue
757 Bytes
<template>
<div class="palace-grid-box" v-if="grids && grids.list && grids.list.length">
<div class="box">
<div class="img-box" v-for="(item, index) in grids.list" :key="index" @click="jump(item)">
<img v-lazy="item.img" class="img" mode="widthFix" />
</div>
</div>
</div>
</template>
<script>
export default {
name: "palaceGrid",
data: function () {
return {
}
},
props: ["grids"],
methods: {
/**
* 点击跳转事件绑定
*/
jump(item) {
this.$emit("jump", item);
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style rel="stylesheet/less" lang="less">
@import './palaceGrid';
</style>