Skip to content

How to pass properties to setup through a function? #9000

Answered by Domain
Domain asked this question in Help/Questions
Discussion options

You must be logged in to vote

OK, I figure it out. Just pass the properties as a whole object!

const defineCmd = (tmpl, properties) => {
    return defineComponent({
        template: tmpl,
        setup() {
            return properties;
        },
        components: {
            cmd
        }
    }
    );
};

defineCmd(`<cmd :label="$t('commands.status')" color="positive" :url="Constant.URL.Servers"" />`, {Constant})

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Domain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant