A
A
Alexander Florenko2019-07-16 11:32:03
Microsoft Edge
Alexander Florenko, 2019-07-16 11:32:03

Why doesn't following a link work in edge (vue.js)?

Hello.
I have a link component.

<a :href="link"
       @click="clickFacebook"
       class="NS-button NS-button__facebook-ico"
       target="_self"
    >
        <span class="ico--wrap">
           <svg>...</svg>
        </span>
        <span v-if="!isLoaded" v-html="title"></span>
        <i class="fa reg__next--spin" v-else></i>
    </a>

methods: {
    async clickFacebook () {
        this.isLoaded = true;
        await this.clickEventSave(this.someEventsName.clickButton.buttonThroughFacebook);
        this.$emit('click');
    }
},

The parent component has a click event
<facebook-link
    class="hide-icon-xs"
    :link="links.facebook"
    :title="$t('landings_registration.pageSignup_RegFacebook')"
    @click="dataLayerPush(facebookDataLayer)"
>
</facebook-link>

The problem is that the Edge browser does not follow the link, only after the second click.
How to be?
What am I doing wrong?
"vue": "^2.5.17",

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FullStack Alex, 2019-07-30
@FullStackAlex

If the problem is with JavaScript and not with CSS (for example, if some element covers part of the button), then perhaps you just need to expand the "radius" of Babel.
https://webpack.js.org/loaders/babel-loader/
https://cli.vuejs.org/config/#babel
My "native" (i.e. without vue-cli) webpack.common.js :

module.exports = {
    entry: {},
    resolve: {
        alias: { },
        extensions: []
    },
    plugins: [ ],
    module: {
        rules: [
            {
                test: /\.js$/,
                loader: 'babel-loader',
                exclude: /node_modules/,
                options: {
                    presets: ['@babel/preset-env'],
                    plugins: [
                        '@babel/plugin-proposal-object-rest-spread',
                        '@babel/plugin-syntax-dynamic-import',
                        'transform-es2015-arrow-functions'
                    ]
                }
            },
        ]
    }
};

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question