This article is intended to be a starting point for discussion. For detailed documentation and easycom specifications, please visit the uni-app official website. 【Portal】easycom mode description Introduction to easycom component mode
uni-app is developed based on VUE. Usually, components are installed first, then imported and registered globally or locally. Then you can use the corresponding components in the page. The process is rather cumbersome, but uni-app uses the easycom component model to simplify the above three steps, allowing users to use components directly on the page without referencing or registering them. Of course, the premise is to follow certain easycom specifications. The actual use effect is as follows: <template> <view class="container"> <uni-list> <uni-list-item title="First row"></uni-list-item> <uni-list-item title="Second row"></uni-list-item> </uni-list> </view> </template> <script> // There is no need to import or register the uni-list component in components. In template, you can directly use export default { data() { return { } } } </script> uni-app default easycom specificationIf you want to use components directly in the page like the above code block, you need to follow the following specifications when installing components or customizing components:
Taking the uni- Custom component placement directory
Easycom is automatically enabled and does not need to be enabled manually. If needed, you can customize the settings in the easycom routine in The official reference custom configuration rules are as follows: "easycom": { "autoscan": true, "custom": { "uni-(.*)": "@/components/uni-$1.vue", // Matches vue files in the components directory "vue-file-(.*)": "packageName/path/to/vue-file-$1.vue" // Matches vue files in node_modules} } uVIew configuration rules are as follows: { // This is the content that needs to be added "easycom": { "^u-(.*)": "@/uview/components/u-$1/u-$1.vue" }, // This is the existing content "pages": [ // ...... ] } Benefits of using easycom
This concludes the article on the practical skills that must be mastered for calling UNI-APP components in easycom mode development. For more relevant easycom mode UNI-APP component content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Summary of SQL query optimization knowledge points for MySQL tens of millions of big data
>>: Linux implements the source code of the number guessing game
Table of contents Preface HTTP HTTP Server File S...
Table of contents Slots What are slots? Slot Cont...
Preface: The storage engine is the core of the da...
Docker is an open source engine that makes it eas...
This article shares the specific code of js to ac...
Although W3C has established some standards for HT...
To improve processing power and concurrency, Web ...
1. New and old domain name jump Application scena...
Request logic Front-end --> Request nginx via ...
This article example shares the specific code for...
No gaps on both sides, gaps between each column w...
A reader contacted me and asked why there were pr...
Table of contents 1. Conventional ideas for time ...
Last week, the teacher gave me a small homework, ...
This article describes the MySQL user rights mana...