【问题标题】:Show loading property on Pageload with nuxt使用 nuxt 在页面加载上显示加载属性
【发布时间】:2017-07-23 23:57:55
【问题描述】:

我有一个运行良好的 nuxt 项目。但是,在加载页面时会执行异步方法。

import charge from '~plugins/charge'
export default {
    asyncData (context, callback) {
        const subscription = context.params.id;
        charge.getAll(subscription, function(result){
            let data = result.data;;
            callback(null, data)
        });
    }
}

我的问题是,在执行异步操作之前,页面会一直保留。在函数返回结果之前,如何显示加载器?

【问题讨论】:

标签: vue.js nuxt.js


【解决方案1】:

在 Nuxt.js repo 中有一个官方的例子。查看Custom-Loading 示例。

【讨论】:

    猜你喜欢
    • 2021-02-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多