说明书组件封装(PDF等类型)

1.showInstructions.vue

<template>
	<div class="bookCont" v-if="isShow">
		<componentsHeader>
			<a class="btn_return" slot='left' @click="closePop">&lt; 返回</a>
	  		<h1 slot='center'>{{books.title}}</h1>
		</componentsHeader>
		<iframe :src="books.src" id="showinstructions" width="100%" height="800"></iframe>
		<div class="readBook">
			&#12288;&#12288;我以阅读《{{books.title}}》 <button @click="nextStep">下一步</button>
		</div>
	</div>
</template>

<script>
	import componentsHeader from '@/components/header.vue'
	export default{
		name:'showInstructions',
		components:{componentsHeader},
		props:{
			books:{
				type:Object,
				default:function () {
		        return {title:"产品说明书",src:""}
		     }
			},
			isShow:{
				type : Boolean,
				default: false
			}
		},
		data () {
			return {}
		},
		methods:{
			closePop(){
				this.$emit("popStateChange")
			},
			nextStep(){
				this.$emit("popStateChange","1")
			}
		},
		mounted(){
			console.log(this.books.src);
		}
		
		
	}
</script>

<style scoped>
.bookCont{
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 940px;
	z-index: 200;
	background-color: #000000;
}
.readBook{
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 60px;
	background-color: #fff;
	font-size: 24px;
}
button{
	display: inline-block;
	/*width: 200px;*/
	height: 50px;
	margin: 0 auto;
	padding:0 40px;
	line-height: 25px;
	border-radius: 34px;
	color: #fff;
	font-weight:lighter;
	font-size: 24px;
	text-align: center;
	border: 1px solid rgba(255, 105, 119,.5);
	/* #cf4061 */
	background-color:#cf4061;
	cursor: pointer;
}
</style>

2.使用

<template>
<showInstructions
            v-if="isShowBook"
            :isShow="isShowBook"
            @popStateChange="changeShowBook"
            :books="currentBook"
        ></showInstructions>
</template>
<script>
import showInstructions from "@/components/showInstructions.vue";
components: {
        showInstructions
    },

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值