Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Component emit events not reaching parent #1104

Open
@mustanggb

Description

@mustanggb

I'm trying to use RootLayout with a nativeView, but I can't seem to get the emit to fire.

I click theDetails button then thenChange button and seedoChange in details, but notonChange in home.

Hopefully I'm just missing something obvious, but I can't figure out what.

https://stackblitz.com/edit/nativescript-vue-nativescript-vue-jkkom7uc


Home.vue

<script lang="ts" setup>import { createNativeView } from 'nativescript-vue';import { getRootLayout } from '@nativescript/core';import Details from './Details.vue';function showDetails() {  const node = createNativeView(Details, {    props: {      onChange(data) {        console.log('onChange in home');      },    },  });  node.mount();  getRootLayout().open(node.nativeView, {    animation: {      enterFrom: {        opacity: 0,        translateY: 50,        duration: 100,      },      exitTo: {        opacity: 0,        duration: 100,      },    },  });}</script><template>  <Frame>    <Page>      <RootLayout rows="*,auto,*">        <Button row="1" @tap="showDetails" text="Details" />      </RootLayout>    </Page>  </Frame></template><style scoped lang="scss"></style>

Details.vue

<script lang="ts" setup>const emit = defineEmits(['change']);function doChange() {  console.log('doChange in details');  emit('change');}</script><template>  <GridLayout rows="*,auto,*" backgroundColor="red" height="10%" width="100%">    <Button row="1" text="Change" @tap="doChange" />  </GridLayout></template><style scoped lang="scss"></style>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp