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

fix: include the tabview element#1064

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
rigor789 merged 1 commit intonativescript-vue:mainfromheywhy:fix-tab-view
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletionsrc/nativescript/elements.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
import { Frame as NSCFrame, Page as NSCPage } from '@nativescript/core';
import {
Frame as NSCFrame,
Page as NSCPage,
TabView as NSCTabView,
TabViewItem as NSCTabViewItem,
} from '@nativescript/core';

import { warn } from '@vue/runtime-core';

Expand DownExpand Up@@ -217,4 +222,33 @@ export function registerCoreElements() {
},
},
);

registerElement(
'TabViewItem',
() => require('@nativescript/core').TabViewItem,
);

registerElement('TabView', () => require('@nativescript/core').TabView, {
model: {
prop: 'selectedIndex',
event: 'selectedIndexChange',
},
nodeOps: {
insert(child, parent) {
const tabView = parent.nativeView as NSCTabView;

if (child.nativeView instanceof NSCTabViewItem) {
const items = tabView.items || [];

parent.setAttribute('items', items.concat([child.nativeView]));
}
},
remove(child, parent) {
const tabView = parent.nativeView as NSCTabView;
const items = tabView.items.filter((item) => item !== child.nativeView);

parent.setAttribute('items', items);
},
},
});
}
2 changes: 1 addition & 1 deletionsrc/registry/index.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { NSVElement, NSVViewFlags } from '../dom';
importtype{ NSVElement, NSVViewFlags } from '../dom';

export type NSVElementResolver = () => any;

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp