from https://www.npmjs.com/package/tns-core-modules
tns-core-modules包的存在只是为了与旧版本的NativeScript兼容。建议现在使用@nativescript/core
我的问题是我将如何使用这个模块
import {ImageSource, fromFile, fromResource, fromBase64} from "tns-core-modules/image-source";
没有兼容性问题
谢谢大家。我终于想通了。
import { ImageSource } from "@nativescript/core";
在我的组件中定义了
let imageSource = new ImageSource();