How to use the marko/legacy-components.defineComponent function in marko

To help you get started, we’ve selected a few marko examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github marko-js / marko / test / components-browser / fixtures-deprecated / preserve-dom-no-id / index.js View on Github external
module.exports = require("marko/legacy-components").defineComponent({
    template: require("./template.marko"),

    init: function() {}
});
github marko-js / marko / test / components-browser / fixtures-deprecated / widget-getWidget / index.js View on Github external
module.exports = require("marko/legacy-components").defineComponent({
    template: require("./template.marko"),

    init: function() {}
});
github marko-js / marko / test / autotests / components-browser-deprecated / widget-stateful-preserve-body / index.js View on Github external
module.exports = require('marko/legacy-components').defineComponent({
    template: require.resolve('./template.marko'),
    getInitialState: function(input) {
        return {
            buttonLabel: 'Initial Button Label'
        };
    },
    getTemplateData: function(state, input) {
        return {
            buttonLabel: state.buttonLabel
        };
    }
});
github marko-js / marko / test / autotests / components-browser-deprecated / widget-event-handler-method-conditional-direct / index.js View on Github external
module.exports = require('marko/legacy-components').defineComponent({
	template: require.resolve('./template.marko'),

	getTemplateData: function(state, input) {
		return {
		};
	},

	init: function() {
		this.mouseMoved = false;
	},

	handleMouseMove: function() {
		this.mouseMoved = true;
	}
});
github marko-js / marko / test / components-browser / fixtures-deprecated / widget-bind-different-roots / index.js View on Github external
module.exports = require("marko/legacy-components").defineComponent({
    template: require("./template.marko"),

    getInitialState: function(input) {
        return { interactive: input.interactive };
    },

    getTemplateData: function(state) {
        return {
            interactive: state.interactive
        };
    }
});
github marko-js / marko / test / autotests / components-browser-deprecated / widget-renderer-and-template / index.js View on Github external
var template = require('marko').load(require.resolve('./template.marko'));

module.exports = require('marko/legacy-components').defineComponent({
    createOut: template.createOut,

    renderer: function(input, out) {
        template.render({
                name: input.name
            },
            out);
    },

    setName: function(name) {
        this.getEl('name').innerHTML = name;
    }
});
github marko-js / marko / test / autotests / components-browser-deprecated / preserve-dom-body / index.js View on Github external
module.exports = require('marko/legacy-components').defineComponent({
    template: require('./template.marko'),
    
    init: function() {

    }
});
github marko-js / marko / test / components-browser / fixtures-deprecated / widget-stateful-update-handler / index.js View on Github external
module.exports = require("marko/legacy-components").defineComponent({
    template: require.resolve("./template.marko"),
    getInitialState: function() {
        return {
            buttonSize: "small",
            buttonLabel: "Initial Label"
        };
    },
    getTemplateData: function(state) {
        return {
            buttonSize: state.buttonSize,
            buttonLabel: state.buttonLabel
        };
    },

    update_buttonSize: function(newSize) {
        var button1Widget = this.getWidget("button1");
github marko-js / marko / test / components-browser / fixtures-deprecated / widget-getWidgets-single / components / app-foo / index.js View on Github external
module.exports = require("marko/legacy-components").defineComponent({
    template: require("./template.marko"),

    init: function() {
        this.name = "app-foo";
    }
});
github marko-js / marko / test / components-browser / fixtures-deprecated / widget-api / index.js View on Github external
module.exports = require("marko/legacy-components").defineComponent({
    template: require("./template.marko"),

    init: function() {}
});