【问题标题】:SimpleDraweeView was not initialized error using Fresco plugin in Nativescript Vue在 Nativescript Vue 中使用 Fresco 插件时 SimpleDraweeView 未初始化错误
【发布时间】:2019-05-06 17:00:01
【问题描述】:

我正在尝试在我的 NS Vue 应用中实现 Fresco。

我的 main.js 中有这个

Vue.registerElement('FrescoDrawee', () => require("nativescript-fresco").FrescoDrawee)

var application = require("application");
var fresco = require("nativescript-fresco");

if (application.android) {
    application.onLaunch = function (intent) {
        fresco.initialize();
    };
}

在 home.vue 中

< FrescoDrawee horizontalAlignment="stretch" height="150" :imageUri="item.avatar" />

这是我遇到的错误。 “SimpleDraweeView 未初始化!”。我很确定我初始化它的方式是错误的。谷歌搜索它给了我 TS 和 Angular 的例子,而原生脚本 Vue 没有。任何帮助将不胜感激

【问题讨论】:

    标签: nativescript nativescript-vue


    【解决方案1】:

    如果您从代码中消除打字,TypeScript 基本上还是 JavaScript。无论您的风格如何(Core / Angular / Vue),您都必须遵循相同的原则。

    if (application.android) {
      application.on("launch", function () {
        fresco.initialize();
      });
    }
    

    来源:https://github.com/NativeScript/nativescript-fresco#how-to-use-nativescript-fresco

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-08-20
      • 2021-01-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-19
      相关资源
      最近更新 更多