Skip to content

能否自定义ViewController? #7

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rushairer opened this issue Feb 12, 2020 · 3 comments
Open

能否自定义ViewController? #7

rushairer opened this issue Feb 12, 2020 · 3 comments

Comments

@rushairer
Copy link

默认的Page是简单的UIViewController.
有时候自己写了复杂的ViewController,又想用ns-vue 的router,怎么样能把自定义的viewcontroller像page那样绑定?

谢谢!

@nuochong
Copy link
Owner

nuochong commented Feb 19, 2020

你所说的我大概理解为能否自己定义并使用不同的页面模版,NSVue中定义页面模版与Vue类似,但又有一些不一样的地方,可以使用动态组件来定义模版(Dynamic Components),这样可以在不同的布局中进行切换。
Demo见nativescript-vue-examples -> 示例 -> 使用动态组件

@rushairer
Copy link
Author

这两天在看了一些ns的源码,我的理解是frame和viewController是对应关系。

现在的解决方案是把UIView注册成NS的组件,NSVue中register一下,直接在页面里用了。

@nuochong
Copy link
Owner

nuochong commented Feb 21, 2020

对于IOS原生不是很了解,你最近有在做有关的项目么?如果需要可以加我微信nc985728992

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants