簡體   English   中英

離子角產品編譯器錯誤類型上不存在屬性“md”

[英]IOnic angular prod compiler error Property 'md' does not exist on type

你好以下代碼

<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
@離子/角度工具包:2.2.0

科爾多瓦:

Cordova CLI:8.1.2 (cordova-lib@8.1.1) 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

您使用 mode 作為雙向綁定變量,因此您必須在 ts 文件中聲明 md 。

有兩種使用模式屬性的方法

1)

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

2)

html

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

ts

md = 'md'

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM