如何解决升级到“@nativescript/core”后找不到 xxport“topmost”
在我的 Nativescript Vue 应用程序中,从 tns-core-modules
更改为 @nativescript/core
,现在我遇到了一些问题。我创建了一个类似于 this video 的模态服务。在那里我使用了导入:
import * as frameModule from 'tns-core-modules/ui/frame';
我现在改为:
import * as frameModule from "@nativescript/core";
第一个问题是如果那是正确的。刚刚找到this。
为了将 Modal 放在前面,我使用:
frameModule.topmost()
现在导致警告:
export 'topmost' (imported as 'frameModule') was not found in '@nativescript/core'
哪一堆可能的出口。但它们听起来都不是我需要的。
(possible exports: AbsoluteLayout,AccessibilityEvents,AccessibilityLiveRegion,AccessibilityRole,AccessibilityState,AccessibilityTrait,ActionBar,ActionItem,ActionItems,ActivityIndicator,AndroidApplication,Animation,AnimationCurve,Application,ApplicationSettings,Background,Binding,Builder,Button,CSSHelper,CSSType,CSSUtils,ChangeType,CoercibleProperty,Color,Connectivity,ContainerView,ContentView,ControlStateChangeListener,CoreTypes,CssAnimationParser,CssAnimationProperty,CssProperty,CustomLayoutView,DatePicker,Device,DialogStrings,Dialogs,DockLayout,EditableTextBase,Enums,File,FileSystemEntity,FlexboxLayout,Folder,Font,FontScaleCategory,FormattedString,Frame,GestureStateTypes,GestureTypes,GesturesObserver,GridLayout,GridUnitType,HtmlView,Http,IOSHelper,Image,ImageAsset,ImageCache,ImageSource,InheritedCssProperty,InheritedProperty,ItemSpec,KeyframeAnimation,KeyframeAnimationInfo,KeyframeDeclaration,KeyframeInfo,Label,LayoutBase,Length,ListPicker,ListView,ModuleNameResolver,NavigationButton,Observable,ObservableArray,Page,PageBase,ParserEvent,ParserEventType,PercentLength,Placeholder,Progress,Property,ProxyViewContainer,PseudoClassHandler,Repeater,RootLayout,Screen,ScrollView,SearchBar,SegmentedBar,SegmentedBarItem,ShorthandProperty,Slider,Span,StackLayout,Style,SwipeDirection,Switch,TabView,TabViewItem,TextBase,TextField,TextView,TimePicker,TouchAction,Trace,Transition,Utils,View,ViewBase,ViewHelper,VirtualArray,WebView,WrapLayout,WrappedValue,XmlParser,_setResolver,action,addTaggedAdditionalCSS,addWeakEventListener,alert,androidDynamicElevationOffsetProperty,androidElevationProperty,animationTimingFunctionConverter,autocapitalizationTypeProperty,autocorrectProperty,backgroundColorProperty,backgroundImageProperty,backgroundInternalProperty,backgroundPositionProperty,backgroundRepeatProperty,backgroundSizeProperty,booleanConverter,borderBottomColorProperty,borderBottomLeftRadiusProperty,borderBottomRightRadiusProperty,borderBottomWidthProperty,borderLeftColorProperty,borderLeftWidthProperty,borderRightColorProperty,borderRightWidthProperty,borderTopColorProperty,borderTopLeftRadiusProperty,borderTopRightRadiusProperty,borderTopWidthProperty,capitalizationType,clipPathProperty,colorProperty,confirm,dismissKeyboardOwner,dismissKeyboardTimeoutId,eachDescendant,editableProperty,encoding,fontFamilyProperty,fontInternalProperty,fontScaleProperty,fontSizeProperty,fontStyleProperty,fontWeightProperty,fromObject,fromObjectRecursive,getAncestor,getCurrentPage,getFileAccess,getRootLayout,getTransformedText,getViewById,heightProperty,hintProperty,horizontalAlignmentProperty,iOSApplication,inputType,isAndroid,isIOS,isUserInteractionEnabledProperty,keyboardTypeProperty,knownFolders,letterSpacingProperty,lineHeightProperty,login,makeParser,makeValidator,marginBottomProperty,marginLeftProperty,marginRightProperty,marginTopProperty,maxLengthProperty,minHeightProperty,minWidthProperty,opacityProperty,paddingBottomProperty,paddingLeftProperty,paddingRightProperty,paddingTopProperty,parseCSSShadow,parseKeyframeDeclarations,path,perspectiveProperty,placeholderColorProperty,platformNames,profile,profilingDisable,profilingDumpProfiles,profilingEnable,profilingIsRunning,profilingResetProfiles,profilingStart,profilingStartCPU,profilingStop,profilingStopCPU,profilingTime,profilingUptime,prompt,removeTaggedAdditionalCSS,removeWeakEventListener,resolveFileNameFromUrl,returnKeyTypeProperty,rotateProperty,rotateXProperty,rotateYProperty,sanitizeModuleName,scaleXProperty,scaleYProperty,setActivityCallbacks,textAlignmentProperty,textDecorationProperty,textShadowProperty,textTransformProperty,timeConverter,transformConverter,translateXProperty,translateYProperty,unsetValue,updateTextTriggerProperty,verticalAlignmentProperty,visibilityProperty,whiteSpaceProperty,widthProperty,zIndexProperty,zeroLength)
感谢任何帮助或猜测。
解决方法
Nativescript 8 的导入略有不同
import { Frame } from '@nativescript/core';
// and you can use it like this:
Frame.topmost()
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。