Skip to content

data-option-<​name>

Configure the options of components from your HTML with data-option-<name> attributes.

data-option-no-<​name>

Negate a boolean option's value by prefixing its name with no-.

js
import { 
Base
} from '@studiometa/js-toolkit';
/** * @extends {Base<{ $options: { open: boolean } }>} */ class
Component
extends
Base
{
static
config
= {
name
: 'Component',
options
: {
open
: {
type
:
Boolean
,
default
: true,
}, }, };
mounted
() {
console
.
log
(this.
$options
.
open
); // false
} }
html
<div data-component="Component" data-option-no-open></div>

MIT Licensed