typescript - 在 Typescript 支持下启动新的 nativescript-vue 项目的正确方法是什么?
问题描述
我希望能够在 Vue 实例方法中使用 Typescript,如nativescript-vue.org的博客页面中所述
当我创建一个新的 nativescript-vue 项目时vue init nativescript-vue/vue-cli-template <project-name>
,调试屏幕中会出现以下警告。
tns debug android
总是给出以下错误行...
JS: '{NSVue (Vue: 2.6.10 | NSVue: 2.5.0)} -> CreateElement(NativePage)'
JS: '{NSVue (Vue: 2.6.10 | NSVue: 2.5.0)} -> CreateElement(NativeActionBar)'
JS: '{NSVue (Vue: 2.6.10 | NSVue: 2.5.0)} -> AppendChild(ElementNode(nativepage), ElementNode(nativeactionbar))'
JS: '{NSVue (Vue: 2.6.10 | NSVue: 2.5.0)} -> CreateElement(nativegridlayout)'
JS: '{NSVue (Vue: 2.6.10 | NSVue: 2.5.0)} -> CreateElement(nativelabel)'
JS: '{NSVue (Vue: 2.6.10 | NSVue: 2.5.0)} -> AppendChild(ElementNode(nativegridlayout), ElementNode(nativelabel))'
JS: '{NSVue (Vue: 2.6.10 | NSVue: 2.5.0)} -> AppendChild(ElementNode(nativepage), ElementNode(nativegridlayout))'
JS: '{NSVue (Vue: 2.6.10 | NSVue: 2.5.0)} -> AppendChild(ElementNode(nativeframe), ElementNode(nativepage))'
这些以 JS:... 行开头的样板警告是什么?
更新
JS 错误行在我添加后开始@vue/devtools nativescript-toasty nativescript-socketio nativescript-vue-devtools
即使我删除它们,控制台警告仍然存在。
我想知道,如果快速启动页面已过时?由于Vue-cli-template在过去 30 天内没有得到任何更新。
注意:创建的项目tns create
不会出现此类错误。只有 vue-cli-template 有警告。
解决方案
日志中提到的行既不是错误也不是警告——它们是渲染器日志。
这些可以通过关闭
Vue.config.silent = true
// Since NativeScript-Vue 2.5.0-alpha.3 the renderer logs
// can be disabled keeping other useful logs intact via
Vue.config.suppressRenderLogs = false
在app.js
或main.js
(取决于使用的模板)。
推荐阅读
- django - 如何在 django rest 框架中解析 JSON
- angular - 角primeng fullcalendar句柄更改事件日期
- eclipse - Eclipse 2019 12 Runtime Environment 缺少 Tomcat 9.0
- javascript - 在没有任何库的情况下更改 node.js 上的 .png 图像
- java - 如何在java中从其他类初始化静态最终变量
- angular - Angular 8和组件之间的路由而不会丢失状态
- python - python请求给
- angular - ngrx 8:来自 reducer 函数的 @ngrx/data 实体的访问状态
- python-3.x - 如何更改字符串的特定部分?
- javascript - 选择 6 个下拉选项之一时 Javascript 隐藏字段