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
Perform the following operations in the Ubuntu co...
Using UNION Most SQL queries consist of a single ...
Table of contents Configuration command steps in ...
See the effect first Implementation Code <div ...
Any number of statements can be encapsulated thro...
With the popularity and maturity of Docker, it ha...
Table of contents 1. Front-end control 1. In the ...
Effect Fading from top to bottom Source code html...
I'm using a placeholder in a text input and i...
1. Introduction As we all know, in the applicatio...
When the front-end and back-end interact, sometim...
Load one or more features <template> <di...
Several commonly used string methods in JavaScrip...
<!doctype html> <html xmlns="http:/...
There are many articles about ssh server configur...