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
XHTML Headings Overview When we write Word docume...
Table of contents Overview 1. Creation of Refs ob...
Table of contents 1. Data Type 1.1 Why do we need...
transform and translate Transform refers to trans...
The following are its properties: direction Set th...
I encountered a case at work that I had never wri...
When using Docker containers, it is more convenie...
Problem Description I recently encountered a prob...
When you start working on a project, it’s importa...
Volume data volume is an important concept of Doc...
Problem Description When we are working on a proj...
In this article, we will analyze the production of...
Table of contents Overview The role of reverse pr...
Table of contents Audio transcoding tools princip...
The problem is as follows: I entered the command ...