backBox.vue 1.01 KB
<template>
    <div class="back-box" v-if="backs">
		<div class="box">
			<div class="back" v-if="backs.back" @click="back">
				<img :src="backs.back.img" class="img" />
			</div>
			<div class="share" v-if="backs.share" @click="doShare">
				<img :src="backs.share.img" class="img" />
			</div>
		</div>
    </div>
</template>

<script>
    export default {
        data: function () {
            return {
                
            }
        },
        props: ["backs", "params"],
		methods: {
			
			/**
			 * 后退
			 */
			back() {
				if (typeof this.backs.back === "object" && typeof this.backs.back.func === "function") {
					this.backs.back.func();
				}
			},
			
			/**
			 * 分享
			 */
			doShare() {
				if (typeof this.backs.share === "object" && typeof this.backs.share.func === "function") {
					this.backs.share.func();
				}
			}
		}
    }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style rel="stylesheet/less" lang="less" scoped>
    @import './back_box';
</style>