Javascript 如何在Vue本机应用程序中实现nativescript加载指示器
我正在尝试实现nstudio/nativescript加载指示器,但在我的Vue本机应用程序中无法正常工作Javascript 如何在Vue本机应用程序中实现nativescript加载指示器,javascript,vue.js,nativescript,Javascript,Vue.js,Nativescript,我正在尝试实现nstudio/nativescript加载指示器,但在我的Vue本机应用程序中无法正常工作 import {LoadingIndicator,Mode,OptionsCommon} from '@nstudio/nativescript-loading-indicator'; const indicator = new LoadingIndicator(); export default { data() { return {
import {LoadingIndicator,Mode,OptionsCommon} from '@nstudio/nativescript-loading-indicator';
const indicator = new LoadingIndicator();
export default {
data() {
return {
}
},
mounted() {
indicator.show();
this.homeFirstbanner();
this.justArrivals();
this.getCategory();
}
}
该视图应该是界面中的有效uiView。给StackLayout一个Id,然后瞄准它。
例如:view:page.getViewById(“stackLayout”)
从
已更新请添加适当的代码和/或可能的问题示例。再次检查我已编辑我的问题您没有将
加载指示器
添加到您的页面/视图中。在模板中包含指示符并绑定忙属性。如何在模板中包含指示符并绑定忙属性?我是nativeScript VueIt的新手,它与{N}无关,只是标准的vue模板。仅参考获取的错误消息未定义UIView
const LoadingIndicator = require('@nstudio/nativescript-loading-indicator').LoadingIndicator;
const Mode = require('@nstudio/nativescript-loading-indicator').Mode;
const loader = new LoadingIndicator();
import { Page } from 'tns-core-modules/ui/page';
// optional options
// android and ios have some platform specific options
const options = {
message: 'Loading...',
details: 'Additional detail note!',
progress: 0.65,
margin: 10,
dimBackground: true,
color: '#4B9ED6', // color of indicator and labels
// background box around indicator
// hideBezel will override this if true
backgroundColor: 'yellow',
userInteractionEnabled: false, // default true. Set false so that the touches will fall through it.
hideBezel: true, // default false, can hide the surrounding bezel
mode: Mode.AnnularDeterminate, // see options below
android: {
view: page.getViewById('stackView'), // Target view to show on top of (Defaults to entire window)
cancelable: true,
cancelListener: function(dialog) {
console.log('Loading cancelled');
}
},
ios: {
view: page.getViewById('stackView') // Target view to show on top of (Defaults to entire window)
}
};
loader.show(options); // options is optional
// Do whatever it is you want to do while the loader is showing, then
loader.hide();