src/clientVueLoader.js
// Compiles all the tags to create the vue component.
Compiles all the tags to create the vue component.
Compiles all the tags to create the vue component .
async compile() {
            const compilations = [];
            if (this.script) {
                await this.script.compile();
            }
            for (let tagName in this.tags) {
                if (tagName === "script") {
                    continue;
                }
                for (let tag of this.tags[tagName]) {
                    compilations.push(tag.compile());
                }
            }
            await Promise.all(compilations);
            if (this.tags["style"]) {
                const styles = {};
                for (let tagContext of this.tags["style"]) {
                    if (tagContext.result) {
                        const [tag, value] = tagContext.result;
                        if (styles[tag]) {
                            Object.assign(styles[tag], value);
                        } else {
                            styles[tag] = value;
                        }
                    }
                }
                for (let element in styles) {
                    Object.freeze(styles[element]);
                }
                this.moduleStyles = styles;
            }
        }
async compile ( ) { const compilations = [ ] ; if ( this . script ) { await this . script . compile ( ) ; } for ( let tagName in this . tags ) { if ( tagName === "script" ) { continue ; } for ( let tag of this . tags [ tagName ] ) { compilations . push ( tag . compile ( ) ) ; } } await Promise . all ( compilations ) ; if ( this . tags [ "style" ] ) { const styles = { } ; for ( let tagContext of this . tags [ "style" ] ) { if ( tagContext . result ) { const [ tag , value ] = tagContext . result ; if ( styles [ tag ] ) { Object . assign ( styles [ tag ] , value ) ; } else { styles [ tag ] = value ; } } } for ( let element in styles ) { Object . freeze ( styles [ element ] ) ; } this . moduleStyles = styles ; } }
Compiles all the tags to create the vue component.
Compiles all the tags to create the vue component .
// Ensure the order: script ... // Merge style results. // Freeze the object to be read only.