记录vue-fullpage关于license报错的问题解决方案
项目中需要用到整屏滚动,想着自己写一个,网上搜了搜发现fullpage符合要求,由于项目用的是vue写的,发现vue整合过fullpage,于是下载了vue-fullpage,一切准备就绪,运行项目发现报错
fullPage: Fullpage.js version 3 has changed its license to GPLv3 and it requires a licenseKey
option. Read about it here:
网上搜索解决方案,统一全部是:
在fullpage.js文件中查找licenseKey,删除如下代码
if*(!isOK){
showError(‘error’, ‘Fullpage.js version 3 has changed its license to GPLv3 and it requires a licenseKey
option. Read about it here:’);
showError(‘error’, ‘https://github.com/alvarotrigo/fullPage.js#options.’);
}***
于是试了试,发现无效,后发现node_modules里面的fullpage.js并不是项目中使用到的插件,项目中用到的是vue-fullpage.js。修改整个fullpage.js甚至完全格式化都并不影响项目运行。于是继续去vue-fullpage找答案,在vue-fullpage的dist文件夹下找到了vue-fullpage.js文件,将下面的 function $ t里面的内容全部清空后问题解决。
以下为$ t中的内容:
var e=g.licenseKey,t=“font-size: 15px;background:yellow;”;n?e&&e.length<20&&(console.warn("%c This website was made using fullPage.js slider. More info on the following website:",t),console.warn("%c https://alvarotrigo.com/fullPage/",t)):(Vn(“error”,“Fullpage.js version 3 has changed its license to GPLv3 and it requires a licenseKey
option. Read about it here:”),Vn(“error”,“https://github.com/alvarotrigo/fullPage.js#options.”)),Gn(s,dn)?Vn(“error”,“Fullpage.js can only be initialized once and you are doing it multiple times!”):(g.continuousVertical&&(g.loopTop||g.loopBottom)&&(g.continuousVertical=!1,Vn(“warn”,“Option loopTop/loopBottom
is mutually exclusive with continuousVertical
; continuousVertical
disabled”)),!g.scrollOverflow||!g.scrollBar&&g.autoScrolling||Vn(“warn”,“Options scrollBar:true and autoScrolling:false are mutually exclusive with scrollOverflow:true. Sections with scrollOverflow might not work well in Firefox”),!g.continuousVertical||!g.scrollBar&&g.autoScrolling||(g.continuousVertical=!1,Vn(“warn”,“Scroll bars (scrollBar:true
or autoScrolling:false
) are mutually exclusive with continuousVertical
; continuousVertical
disabled”)),g.scrollOverflow&&null==g.scrollOverflowHandler&&(g.scrollOverflow=!1,Vn(“error”,“The option scrollOverflow:true
requires the file scrolloverflow.min.js
. Please include it before fullPage.js.”)),g.anchors.forEach(function(t){var e=[].slice.call(Zn("[name]")).filter(function(e){return e.getAttribute(“name”)&&e.getAttribute(“name”).toLowerCase()==t.toLowerCase()}),n=[].slice.call(Zn("[id]")).filter(function(e){return e.getAttribute(“id”)&&e.getAttribute(“id”).toLowerCase()==t.toLowerCase()});if(n.length||e.length){Vn(“error”,“data-anchor tags can not have the same value as any id
element on the site (or name
element for IE).”);var o=n.length?“id”:“name”;(n.length||e.length)&&Vn(“error”,’"’+t+’" is is being used by another element '+o+"
property")}}))