本文整理汇总了TypeScript中classnames.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: beforeEach
beforeEach(() => {
const classesRichEditor = richEditorClasses(false);
document.body.innerHTML = `<div>
<div class="FormWrapper"><div id="quillNoEditor"></div></div>
<div class=${classNames("richEditor", classesRichEditor.root)}><div id="quillNoForm"></div></div>
<div class="FormWrapper">
<button id="buttonBefore"></button>
<div class=${classNames("richEditor", classesRichEditor.root)}>
<div id="quill"></div>
<button id="button1"></button>
</div>
</div>
</div>`;
quill = new Quill("#quill");
embedFocusModule = new FocusModule(quill);
});
示例2: addMboxClass
addMboxClass (element) {
element.className = classnames(element.className, {
mboxDefault: element.className.indexOf('mboxDefault') === -1
});
}
示例3:
///<reference path='classnames.d.ts' />
import classNames from 'classnames';
classNames('foo', 'bar'); // => 'foo bar'
classNames('foo', 'bar'); // => 'foo bar'
classNames('foo', { bar: true }); // => 'foo bar'
classNames({ foo: true }, { bar: true }); // => 'foo bar'
classNames({ foo: true, bar: true }); // => 'foo bar'
classNames(10, 11); // => '10 11';
// lots of arguments of various types
classNames('foo', { bar: true, duck: false }, 'baz', { quux: true }); // => 'foo bar baz quux'
classNames(['foo', 'bar', 'baz']); // => 'foo bar baz'
classNames([1, 2, 3]); // => '1 2 3'
classNames([{ foo: true, bar: false }, { baz: true }]); // => 'foo baz'
classNames(["foo", ["bar", {baz: true}]]); // => 'foo bar baz'
// other falsy values are just ignored
// NOTE: We don't really want to allow this kind of thing with Typescript (otherwise what's the point!)
//classNames(null, false, 'bar', undefined, 0, 1, { baz: null }, ''); // => 'bar 1'
示例4: classNames
import classNames from "classnames";
let classNamesResult = classNames(["allowSyntheticDefaultImports", "is", "here"]);
console.log(classNamesResult);