|
|
|
@ -136,16 +136,16 @@ export default class Slot extends Element {
|
|
|
|
|
|
|
|
|
|
getStaticAttributeValue(name: string) {
|
|
|
|
|
const attribute = this.attributes.find(
|
|
|
|
|
(attr: Node) => attr.name.toLowerCase() === name
|
|
|
|
|
attr => attr.name.toLowerCase() === name
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (!attribute) return null;
|
|
|
|
|
|
|
|
|
|
if (attribute.value === true) return true;
|
|
|
|
|
if (attribute.value.length === 0) return '';
|
|
|
|
|
if (attribute.isTrue) return true;
|
|
|
|
|
if (attribute.chunks.length === 0) return '';
|
|
|
|
|
|
|
|
|
|
if (attribute.value.length === 1 && attribute.value[0].type === 'Text') {
|
|
|
|
|
return attribute.value[0].data;
|
|
|
|
|
if (attribute.chunks.length === 1 && attribute.chunks[0].type === 'Text') {
|
|
|
|
|
return attribute.chunks[0].data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|