Content-Length: 353608 | pFad | http://github.com/nativescript-vue/nativescript-vue/commit/3c5f708d0bfe555ddaa247266d8941b1688a0484

66 fix: include the tabview element (#1064) · nativescript-vue/nativescript-vue@3c5f708 · GitHub
Skip to content

Commit 3c5f708

Browse files
authored
fix: include the tabview element (#1064)
1 parent a52595f commit 3c5f708

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

src/nativescript/elements.ts

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { Frame as NSCFrame, Page as NSCPage } from '@nativescript/core';
1+
import {
2+
Frame as NSCFrame,
3+
Page as NSCPage,
4+
TabView as NSCTabView,
5+
TabViewItem as NSCTabViewItem,
6+
} from '@nativescript/core';
27

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

@@ -218,4 +223,33 @@ export function registerCoreElements() {
218223
},
219224
},
220225
);
226+
227+
registerElement(
228+
'TabViewItem',
229+
() => require('@nativescript/core').TabViewItem,
230+
);
231+
232+
registerElement('TabView', () => require('@nativescript/core').TabView, {
233+
model: {
234+
prop: 'selectedIndex',
235+
event: 'selectedIndexChange',
236+
},
237+
nodeOps: {
238+
insert(child, parent) {
239+
const tabView = parent.nativeView as NSCTabView;
240+
241+
if (child.nativeView instanceof NSCTabViewItem) {
242+
const items = tabView.items || [];
243+
244+
parent.setAttribute('items', items.concat([child.nativeView]));
245+
}
246+
},
247+
remove(child, parent) {
248+
const tabView = parent.nativeView as NSCTabView;
249+
const items = tabView.items.filter((item) => item !== child.nativeView);
250+
251+
parent.setAttribute('items', items);
252+
},
253+
},
254+
});
221255
}

src/registry/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NSVElement, NSVViewFlags } from '../dom';
1+
import type { NSVElement, NSVViewFlags } from '../dom';
22

33
export type NSVElementResolver = () => any;
44

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/nativescript-vue/nativescript-vue/commit/3c5f708d0bfe555ddaa247266d8941b1688a0484

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy