【问题标题】:IOnic angular prod compiler error Property 'md' does not exist on typeIonic angular prod 编译器错误属性“md”在类型上不存在
【发布时间】:2020-07-05 18:12:00
【问题描述】:

下面的代码你好

<ion-segment value="{{selectedWor}}" (ionChange)="worshipTypeChanged($event)" [mode]="md">

我在运行时收到以下错误:ionic build --prod。 (没有 --prod 没有编译器错误)

ERROR in src/app/pages/map/map.html(38,85): Property 'md' does not exist on type 'MapPage'.

[ERROR] An error occurred while running subprocess ng.

        ng.cmd run app:build:production exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

有什么想法吗?文档说我可以做到..

这是我的离子信息。

离子:

离子 CLI:5.4.6 (C:\Users\ginil\AppData\Roaming\npm\node_modules\ionic) 离子 框架:@ionic/angular 5.0.4
@angular-devkit/build-angular:0.803.24 @angular-devkit/schematics : 8.3.20 @angular/cli : 8.3.20
@ionic/angular-toolkit:2.2.0

科尔多瓦:

Cordova CLI:8.1.2 (cordova-lib@8.1.1) Cordova 平台 :不可用 Cordova 插件:不可用

实用程序:

cordova-res:0.5.1 本机运行:0.2.7

系统:

NodeJS : v11.11.0 (C:\Program Files\nodejs\node.exe) npm : 6.7.0 操作系统:Windows 10

【问题讨论】:

标签: angular cordova ionic-framework ionic4 ionic5


【解决方案1】:

您将模式用作双向绑定变量,因此您必须在 ts 文件中声明 md。

mode属性有两种使用方式

1)

<ion-segment value="{{selectedWor}}" (ionChange)="worshipTypeChanged($event)" mode="md">

2)

html

<ion-segment value="{{selectedWor}}" (ionChange)="worshipTypeChanged($event)" [mode]="md">

ts

md = 'md'

【讨论】:

    猜你喜欢
    • 2021-05-13
    • 1970-01-01
    • 2019-03-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-04
    相关资源
    最近更新 更多