前端开发我爱编程

在VUE中使用bookreader 插件

2018-04-09  本文已影响14人  WestLonely
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>book-reader</title>
    <script src="./static/BookReader/jquery-1.10.1.js"></script>
    <script src="./static/BookReader/jquery-ui-1.12.0.min.js"></script>
    <script src="./static/BookReader/jquery.browser.min.js"></script>
    <script src="./static/BookReader/jquery.bt.min.js"></script>
    <script src="./static/BookReader/dragscrollable-br.js"></script>
    <script src="./static/BookReader/jquery.colorbox-min.js"></script>
    <link rel="stylesheet" href="./static/BookReader/BookReader.css">

</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
<script src="./static/BookReader/BookReader.js"></script>
</body>
</html>
<template>
    <div id="BookReader" class="hello"></div>
</template>

<script>
    export default {
        name: 'HelloWorld',
        data () {
            return {
                options: {
                    data: [
                        [
                            {
                                width: 800, height: 1200,
                                uri: 'http://img0.imgtn.bdimg.com/it/u=4212717079,3052071093&fm=27&gp=0.jpg'
                            },
                            {
                                width: 800, height: 1200,
                                uri: 'http://img0.imgtn.bdimg.com/it/u=4212717079,3052071093&fm=27&gp=0.jpg',
                            }
                        ],
                        [
                            {
                                width: 800, height: 1200,
                                uri: 'http://img0.imgtn.bdimg.com/it/u=4212717079,3052071093&fm=27&gp=0.jpg'
                            },
                            {
                                width: 800, height: 1200,
                                uri: 'http://img0.imgtn.bdimg.com/it/u=4212717079,3052071093&fm=27&gp=0.jpg',
                            }
                        ],
                        [
                            {
                                width: 800, height: 1200,
                                uri: 'http://img0.imgtn.bdimg.com/it/u=4212717079,3052071093&fm=27&gp=0.jpg'
                            },
                            {
                                width: 800, height: 1200,
                                uri: 'http://img0.imgtn.bdimg.com/it/u=4212717079,3052071093&fm=27&gp=0.jpg',
                            }
                        ],
                        [
                            {
                                width: 800, height: 1200,
                                uri: 'http://img0.imgtn.bdimg.com/it/u=4212717079,3052071093&fm=27&gp=0.jpg'
                            },
                            {
                                width: 800, height: 1200,
                                uri: 'http://img0.imgtn.bdimg.com/it/u=4212717079,3052071093&fm=27&gp=0.jpg',
                            }
                        ],
                        [
                            {
                                width: 800, height: 1200,
                                uri: 'http://img0.imgtn.bdimg.com/it/u=4212717079,3052071093&fm=27&gp=0.jpg'
                            },
                            {
                                width: 800, height: 1200,
                                uri: 'http://img0.imgtn.bdimg.com/it/u=4212717079,3052071093&fm=27&gp=0.jpg',
                            }
                        ],

                    ],
                    ui: 'full', // embed, full (responsive)

                    el: '#BookReader',
                }
            }
        },
        mounted () {
                new BookReader ( this.options ).init ()
        }
    }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
    /*@import "../assets/BookReader/BookReader.css";*/

    body {
        background-color: #939598;
    }

    /* Hide print and embed functionality */
    .BRtoolbar .embed, .print {
        display: none;
    }

    .BookReader {
        width: 800px;
        height: 600px;
        overflow: hidden;
    }

</style>

上一篇下一篇

猜你喜欢

热点阅读