Javascript 在Sage 9中导入FullPage.js
我正在尝试在我的Sage主题中导入Fullpage.js。 我安装了FullPageScroll,其中包括:Javascript 在Sage 9中导入FullPage.js,javascript,npm,wordpress-theming,yarnpkg,roots-sage,Javascript,Npm,Wordpress Theming,Yarnpkg,Roots Sage,我正在尝试在我的Sage主题中导入Fullpage.js。 我安装了FullPageScroll,其中包括: npm install fullpage.js 添加了以下代码:scripts/main.js: // import external dependencies import 'jquery'; import 'fullpage.js/vendors/scrolloverflow.js'; import 'fullpage.js/dist/fullpage.js'; 和:script
npm install fullpage.js
添加了以下代码:scripts/main.js:
// import external dependencies
import 'jquery';
import 'fullpage.js/vendors/scrolloverflow.js';
import 'fullpage.js/dist/fullpage.js';
和:scripts/routes/home.js:
// Initializing it
$('#fullpage').fullpage({
//options here
autoScrolling: true,
//Navigation
navigation: true,
navigationPosition: 'left',
});
//methods
$.fn.fullpage.setAllowScrolling(true);
但仍然出现了这个错误(我遵循了Sage手册第6.6章中的说明):
未捕获类型错误:fullpage不是构造函数
投票表决以缓解标签混淆。