class myPlugin {
constructor(element, options) {
this.element = element
this.options = Object.assign({}, {
option1: false,
option2: 600
}, options)
}
testMyEvent(){
if (typeof this.options.onEvent === 'function') {
this.options.onEvent(this.element, 123, this.options /* что угодно */);
}
}
}const plugin = new myPlugin("#element", {
option1: false,
option2: 600,
onEvent: (element, num, opts) => {
console.log(element, num, opts)
}
});
plugin.testMyEvent(); overscroll-behavior .two {
overscroll-behavior: none;
} http://localhost:3001 в браузере и увидите свой сайт.ctrl+С и завершите процесс.npm run build, чтобы уже собрать отлаженные файлы в билд. $result = [];
foreach ($medias as $key => &$media) {
if () {
//....
$result[] = array(
'type' => 1,
'preview' => $img,
'content' => $link
);
} elseif () {
//....
$result[] = array(
'type' => 1,
'preview' => $img,
'content' => $link
);
} elseif () {
//....
$result[] = array(
'type' => 1,
'preview' => $img,
'content' => $link
);
}
}
echo json_encode($result); function camelize(str) {
return str
.split('-')
.map(function(word, index) {
if (index == 0) {
return word;
} else {
return word[0].toUpperCase() + word.slice(1);
}
})
.join('')
}
let str = prompt('Введите текст через дефис');
alert(camelize(str));function camelize(str) {
return str
.split('-')
.map((word, index) => index == 0 ? word : word[0].toUpperCase() + word.slice(1))
.join('')
}
let str = prompt('Введите текст через дефис');
alert(camelize(str));const upper = (word, index) => index == 0 ? word : word[0].toUpperCase() + word.slice(1);
function camelize(str) {
return str
.split('-')
.map(upper)
.join('')
}
let str = prompt('Введите текст через дефис');
alert(camelize(str));const upper = (word, index) => index == 0 ? word : word[0].toUpperCase() + word.slice(1);
const camelize = str => str.split('-').map(upper).join('');
let str = prompt('Введите текст через дефис');
alert(camelize(str)); function validate () {
return src('.')
.pipe(plumberSmart())
.pipe(through2(function (file, enc, callback) {
callback(new PluginError({
plugin: 'validate',
// Именно так форматировать сообщение
message: `${chalk.underline('Привет я строка 1')}
${chalk.cyan('Привет я строка 2')}
Я подведение итогов`
}))
}))
}function validate () {
return src('.')
.pipe(plumberSmart())
.pipe(through2(function (file, enc, callback) {
callback(new PluginError({
plugin: 'validate',
message: `${chalk.underline('Привет я строка 1')}` + '\n' +
`${chalk.cyan('Привет я строка 2')}` + '\n' +
'\n' +
`Я подведение итогов`
}))
}))
}