在 Nativescript Vue 中使用 Fresco 插件时 SimpleDraweeView 未初始化错误
SimpleDraweeView was not initialized error using Fresco plugin in Nativescript Vue
我正在尝试在我的 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 was not initialized!"。我很确定我初始化它的方式是错误的。谷歌搜索它给了我 TS 和 Angular 的例子,以及 none 的 nativescript Vue。任何帮助将不胜感激
如果您从代码中消除输入,大多数情况下 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
我正在尝试在我的 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 was not initialized!"。我很确定我初始化它的方式是错误的。谷歌搜索它给了我 TS 和 Angular 的例子,以及 none 的 nativescript Vue。任何帮助将不胜感激
如果您从代码中消除输入,大多数情况下 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