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

tab-view selectedIndex should be selectedTab #50

Closed
@saknarak

Description

@saknarak

In samplesamples/app/app-with-tab-view.js

<tab-view :selectedIndex="selectedTab">

But in fileplatform/nativescript/runtime/components/tab-view.js has propselectedTab

export default {  name: 'tab-view',  props: ['selectedTab'],

I try to change two-way binding but it's not work

export default {  name: 'tab-view',  model: {    prop: 'selectedTab',    event: 'selectedTabChanged',  },  props: ['selectedTab'],  template: `<native-tab-view ref="tabView" v-model="selectedIndex"><slot></slot></native-tab-view>`,  data() {    return {      selectedIndex: 0    }  },  watch: {    selectedTab(index) {      this.selectedIndex = index    },    selectedIndex(index) {      this.$emit('selectedTabChanged', index)    },  },  methods: {    registerTab(tabView) {      let items = this.$refs.tabView.nativeView.items || []      this.$refs.tabView.setAttribute('items', items.concat([tabView]))    }  }}

NOT WORK

<tab-view v-model="curTabIndex"></tab-view>

WORK

<tab-view :selectedTab="curTabIndex" @selectedTabChanged="idx => curTabIndex = idx"></tab-view>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp