日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > HTML >内容正文

HTML

web前端知识点太多_前端知识点总结——框架中报错集锦(含解决方法)

發布時間:2023/12/2 HTML 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 web前端知识点太多_前端知识点总结——框架中报错集锦(含解决方法) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

前端知識點總結——框架中報錯集錦(含解決方法)

1.vue

1、指定template直接返回多個標簽

Component template should contain exactly one root element.

解決方案:指定一個容器,將需要返回的多個標簽放在這個容器中 div/form/a…

2、讀取了一個變量的屬性但是這個變量是undefined

多數情況都是因為作用域問題

Cannot read property ‘*‘ of undefined

3、死循環

解決方案:加上條件的判斷,避免出現死循環

2.ng

1、模板解析失敗

Template parse errors:

‘demo01’ is not a known element:

If ‘demo01’ is an Angular component, then verify that it is part of this module.

If ‘demo01’ is a Web Component then add “CUSTOM_ELEMENTS_SCHEMA” to the ‘@NgModule.schemas’ of this component to suppress this message. (“

Hello {{name}}

[ERROR ->]

解決方案:

是以模塊為基本單位,所創建的組件到要指定屬于哪個模塊

2、ZoneAwareError

點開,查看message

3、Can’t have multiple template bindings on one element.

不能在同一個元素上邊 調用多個結構性指令

ng-container

4、No provider for UserService!

DI error !

Dependency Injection 依賴注入

有可能是因為沒有給服務指定提供商

解決方案:

①到模塊或者組件中 指定providers屬性!!

②在引入服務去指定Providers,引入服務的路徑寫錯

5、No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:3000′ is therefore not allowed access

header(‘Access-Control-Allow-Origin:*’);

6、Unexpected value ‘undefined’ imported by the module ‘AppModule

在AppModule引入其他模塊,模塊不存在!

7、沒有給某個組件 去指定 模板內容

(SystemJS) No template specified for component LoginComponent

8、一個selector的名稱用了很多次

More than one component matched on this element.

Make sure that only one component’s selector can match a given element.

解決方案:保證每一個組件的selector名字都是唯一的

3.React

1、Uncaught SyntaxError: embedded: Adjacent JSX elements must be wrapped in an enclosing tag (4:16)

并不是說有未結束的標記,本質原因是不允許直接返回多個標簽

2、Cannot assign to read only property ‘btnName’ of object ‘#’

無法修改props對應的值

ReactNative*

1、Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it’s defined in.

導出的類如果加上了default,引入是無需寫{},寫了花括號就會報錯

引入的組件類的名稱是不是寫錯了

2、The development server returned response error code: 500

500錯誤,內部錯誤,有可能是因為當前啟動的開發服務器失敗。

解決方案:

找到vscode終端,在終端的最下邊,往上找,紅色的error

3、Can’t find variable:

原因:多數都是因為類名稱寫錯

解決方案:反復檢查引入的類名字有沒有寫錯

4、Expected a component class, got [object Object].

不允許出現html標簽

5、undefined is not a function (evaluating ‘arr[typeof Symbol === “function” ? Symbol.iterator : “@@iterator”]()’)

因為手工拷貝過來的nodeModules的問題。

解決方案:只需要開啟遠程js的調試

按下菜單鍵或者搖一搖,在彈出菜單中,選中debug js remotely

總結

以上是生活随笔為你收集整理的web前端知识点太多_前端知识点总结——框架中报错集锦(含解决方法)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。