How can I display function content in vue?

I want to display method content in html. I using computed to show, but I got wrong with ‘function () { [native code] }’.

Here’s code

<template>
    <div>{{ showFuntion }}</div>
</template>

<script>
export default {
    computed: {
        showFuntion() {
            return this.confirm.toString();
        }
    },
    methods: {
        confirm() {
            let a = "1";
            return a;
        }
    }
};
</script>

I want to get content with ‘let a = "1" ;return a;’
, but I get ‘function () { [native code] }’.
How can I get the correct funtion content ?

16 thoughts on “How can I display function content in vue?”

Leave a Comment