Я использую игровую площадку Nativescript IOS и я новичок в Nativescript. Я пытаюсь добавить кнопку ссылки на веб-сайт при нажатии.
<template>
<Page>
<ActionBar title="About Me" />
<ScrollView>
<StackLayout class="home-panel">
<!--Add your page content here-->
<Image
src="https://nexus.leagueoflegends.com/wp-content/uploads/2020/01/01_Banner_Fiddlesticks_Concept_9j7dhjnqxbpc7o0qibqp.jpg"
style="height:800px" />
<Label textWrap="true" text="Play with NativeScript!"
class="h2 description-label" />
<Label textWrap="true"
text="Favorite Type Of Noodles: Ravioli."
class="h2 description-label" />
<Button text="Button" @tap="onButtonTap" class="-primary" />
</StackLayout>
</ScrollView>
</Page>
</template>
<script>
export default {
methods: {
onItemTap: function(args) {
console.log("Item with index: " + args.index + " tapped");
},
onButtonTap() {
console.log("Button was pressed");
}
},
data() {
return {};
}
};
</script>
<style scoped>
.home-panel {
vertical-align: center;
font-size: 20;
margin: 15;
}
.description-label {
margin-bottom: 15;
}
</style>
Я пытался location.href = 'www.yoursite.com';
Но приложение просто по какой-то причине вылетает.
Буду признателен за любую помощь!