Vue中使用fullpage.js

41次阅读

共计 798 个字符,预计需要花费 2 分钟才能阅读完成。

安装
npm install vue-fullpage.js
入口文件 index.js
import Vue from ‘vue’;
// …
import ‘fullpage.js/vendors/scrolloverflow’;
import VueFullPage from ‘vue-fullpage.js’;
// …

Vue.use(VueFullPage);
component.vue
<template>
<div>
<full-page :options=”options”>
<div class=”section”>
<div class=”box1″>
section1
</div>
</div>
<div class=”section”>
<div class=”box2″>
section2
</div>
</div>
<div class=”section”>
<div class=”box3″>
section3
</div>
</div>
</full-page>
</div>
</template>

<script>
export default {
name: ”,
data () {
return {
options: {
licenseKey: ‘OPEN-SOURCE-GPLV3-LICENSE’,
afterLoad: this.afterLoad,
scrollOverflow: true,
scrollBar: false,
menu: ‘#menu’,
// navigation: true,
// anchors: [‘page1’, ‘page2’, ‘page3’],
sectionsColor: [‘#41b883’, ‘#ff5f45’, ‘#0798ec’, ‘#fec401’, ‘#1bcee6’, ‘#ee1a59’, ‘#2c3e4f’, ‘#ba5be9’, ‘#b4b8ab’]
}
}
}
}
</script>

<style lang=”less” scoped>

</style>

正文完
 0