我正在使用webpack和es6。
我在网页Barba.js中有> x <- matrix(replicate(9,1), ncol = 3, nrow = 3)
> x
[,1] [,2] [,3]
[1,] 1 1 1
[2,] 1 1 1
[3,] 1 1 1
> tr(x)
[1] 3
> x <- matrix(replicate(12,1), ncol = 4, nrow = 3)
> x
[,1] [,2] [,3] [,4]
[1,] 1 1 1 1
[2,] 1 1 1 1
[3,] 1 1 1 1
> tr(x)
Fehler in tr(x) : m must be a square matrix
我必须使用Barba事件Barba newPageReady Event重新初始化代码,我有许多单独的模块,例如"use strict";
const winston = require('winston');
const myFormat = winston.format.printf(info => {
return `${info.timestamp} ${info.level}: ${info.message}`;
});
const logger = winston.createLogger({
level: "debug",
format: winston.format.combine(winston.format.timestamp(), myFormat), // winston.format.json(),
transports: [
new winston.transports.File({filename: "logs/error.log", level: 'error'}),
new winston.transports.File({filename: 'logs/combined.log'}),
],
exceptionHandlers: [
new winston.transports.File({ filename: 'logs/exceptions.log' }),
new winston.transports.File({ filename: 'logs/combined.log' })
],
exitOnError: false,
// handleExceptions: true // Otherwise, you should use this in options.
});
process.on('unhandledRejection', (reason, promise) => {
logger.debug(reason);
});
process.on('uncaughtException', (err) => {
logger.debug(err);
});
,page-transition
,menuEvent.js
,parallaxEvent.js
,{{1 }}这些模块将导入到inviewEvent.js
我不知道如何在每个模块中添加touchEvents.js
并在Barba Event中添加初始化脚本...
答案 0 :(得分:0)
解决方案:
menuEventjs:
export class menuEvent {
static init() {
//codes
}
}
Barba:
import { menuEvent } from './menuEvent'
Barba.Dispatcher.on('newPageReady', function(currentStatus, oldStatus, container) {
menuEvent.init()
});