我正在尝试为我的 ionic 4 应用程序创建标签页布局。在我的配置和设置之后,我收到错误错误:无法匹配任何路由。URL 段:“标签”
首先,当我使用标签模板创建默认启动器时,它不起作用。选项卡栏显示但不显示选项卡内容。经过几天的研究和测试,还没有运气。看看我现在有什么;
我的离子信息
Ionic:
ionic (Ionic CLI) : 4.6.0 (C:\Users\Ken\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.0.0-beta.17
@angular-devkit/build-angular : 0.10.7
@angular-devkit/schematics : 7.0.7
@angular/cli : 7.0.7
@ionic/angular-toolkit : 1.2.0
System:
NodeJS : v10.13.0 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10
Run Code Online (Sandbox Code Playgroud)
app-routing.module.ts
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
const routes: Routes = [
{
path: '',
redirectTo: 'home',
pathMatch: 'full'
},
{
path: 'home',
loadChildren: './home/home.module#HomePageModule'
},
{ path: 'tabs', …Run Code Online (Sandbox Code Playgroud) 我正在开发一个 Ionic + Angular 5 项目。
我需要动态加载一些组件。按照Angular 文档中的动态组件加载器示例,我能够成功加载组件并显示它们。
但是,我需要能够遍历加载的组件。
在创建和销毁子组件时,我可以轻松地在父组件中维护自己的组件列表,但在我看来,这很丑陋,而不是“角度方式”。
经过大量实验和研究,似乎我无法使用 @ViewChildren 访问动态添加的组件,因为它们有自己的视图。ViewChildren 未找到动态组件
这样对吗?
我可以使用 viewContainerRef.get() 遍历子视图并检索 ViewRefs。但是似乎没有办法在给定 ViewRef 的情况下获得对组件的引用?
我注意到 ViewRef 的“rootNodes”属性,但是该属性没有记录在 Angular 文档视图参考中。但是,它记录在 EmbeddedViewRef 文档嵌入式视图参考中,但似乎仍然没有让我访问组件。
所以问题是当我有一个动态添加子组件的父级时,我如何从父级循环到子组件(这样我就可以在子级中调用我的方法之一)?我怀疑是我遗漏了一些愚蠢的简单东西,有一些根本的误解,或者我应该使用不同的模式。
我修改了 Dynamic Component Loader 示例以突出显示我正在尝试做的事情。修改后的动态组件加载器
有没有人了解如何在 ionic 中显示一个小工具提示?
我认为必须存在类似“标题”属性的东西,但我找不到它......
我试图在我的 ion-inputs、ion-items 中添加一个 [title]="",但没有任何显示
我需要设置一个自定义图标来进行离子选择。以下是我的代码和输出
<ion-item class="input-container" align-items-center no-padding>
<ion-label position="floating" no-margin no-padding>I am a</ion-label>
<ion-select formControlName="role" mode="ios" okText="Okay" cancelText="Cancel">
<ion-select-option value="Admin">Admin</ion-select-option>
<ion-select-option value="Customer">Customer</ion-select-option>
</ion-select>
<ion-icon color="primary" name="arrow-down" mode="ios" slot="end"></ion-icon>
</ion-item>
Run Code Online (Sandbox Code Playgroud)
有没有其他设置自定义图标的方法,或者任何人都可以建议如何删除 select-icon-inner
我正在使用 Capacitor 来构建我的 Ionic 应用程序。我当然想通过 GPS 在地图上显示当前位置的应用程序。
下面的代码可以工作,并按照我的意愿在地图上为我提供正确的标记,但是......它远非准确。
async getLocation() {
var self = this;
let location = await Geolocation.getCurrentPosition({
enableHighAccuracy: true,
timeout: 1000
});
self.marker.setLngLat([location.coords.longitude, location.coords.latitude])
const wait = Geolocation.watchPosition({enableHighAccuracy: true, timeout: 1000}, (position, err) => {
self.marker.setLngLat([position.coords.longitude, position.coords.latitude])
});
}
Run Code Online (Sandbox Code Playgroud)
标记像疯了一样四处走动。发生在我测试的每个位置。它移动的不是厘米,而是我所在位置周围的数米...
我错过了什么让我的 GPS 坐标不太准确?我以为enableHighAccuracy: true够了,但还不够。
我尝试构建 ionic 4 应用程序。但是,在尝试修复上一个错误后,新错误不断出现。在此错误之后我已经创建了一个自定义组件(如何在离子段内加载其他页面?)然后我收到一个错误:addchilds 组件是 2 个模块声明的一部分。我查找该错误并创建了 shared.module.ts 并将其导入到 app.module.ts 中。但是我仍然遇到错误,这次是
Uncaught Error: Template parse errors:
‘ion-col’ is not a known element:
1. If 'ion-col' is an Angular component, then verify that it is part of this module.
2. If 'ion-col' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<div>
<ion-row no-padding>
[ERROR ->]<ion-col size="6" offset="3">
<img [src]="image" alt="this is the image"/>
</io"): ng:///SharedModule/AddchildsComponent.html@3:10
Run Code Online (Sandbox Code Playgroud)
不幸的是,这个错误也发生在 ion-row、ion-button、ion-input 上。这是最近的代码。
app.module.ts …
我想在单击按钮时更改自定义 svg 图标的颜色
<ion-item>
<ion-icon src="../../assets/img/icon-qr.svg"></ion-icon>
<ion-label>Qr Scan</ion-label>
</ion-item>
Run Code Online (Sandbox Code Playgroud) 我无法在 ionic 5.4.4v 中安装包 Cordova-res 并收到以下错误
**Z:\my program V2\ionicTest\testProj>npm i -g cordova-res**
C:\Users\USER\AppData\Roaming\npm\cordova-res -> C:\Users\USER\AppData\Roaming\npm\node_modules\cordova-res\bin\cordova-res
> sharp@0.22.1 install C:\Users\USER\AppData\Roaming\npm\node_modules\cordova-res\node_modules\sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.4/libvips-8.7.4-win32-x64.tar.gz
C:\Users\USER\AppData\Roaming\npm\node_modules\cordova-res\node_modules\sharp\install\libvips.js:83
throw err;
^
##Error: tunneling socket could not be established, cause=connect ECONNREFUSED 127.0.0.1:80##
at ClientRequest.onError (C:\Users\USER\AppData\Roaming\npm\node_modules\cordova-res\node_modules\tunnel-agent\index.js:177:17)
at Object.onceWrapper (events.js:300:26)
at ClientRequest.emit (events.js:210:5)
at Socket.socketErrorListener (_http_client.js:406:9)
at Socket.emit (events.js:210:5)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
{
code: 'ECONNRESET'
}
C:\Users\USER\AppData\Roaming\npm\node_modules\cordova-res\node_modules\sharp>if …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 Svelte.js 和 Ionic v4 构建一个移动应用程序。
1)我得到了苗条的模板。
2) 使用 npm install @ionic/core@latest --save 安装 ionic。
3) 安装 postcss 并在 global.css 中导入 @ionic css
Rollup 正在提取 @ionic css,但它的工作方式似乎有问题。离子成分是可访问的,但我什么也看不到。未正确应用 css。
有没有人设法让 Svelte 与 Ionic v4 一起工作?或者至少,带有一些香草 js 的 Ionic?
1.哪个更容易开发混合应用程序,Ionic - Angular 或 Ionic - React?
2.哪个性能更好?
3.所有插件都支持Ionic-React和Ionic-Angular吗?
如果有人分享有关此主题的宝贵意见和知识,那就太好了
ionic-framework ×10
ionic4 ×5
angular ×4
cordova ×2
ionic-native ×2
javascript ×2
android ×1
capacitor ×1
css ×1
node.js ×1
postcss ×1
rollupjs ×1
sharp ×1
svelte-3 ×1
tooltip ×1
typescript ×1