Traditional vue components need to be installed, referenced, and registered, and the components can be used after three steps. easycom reduced it to one step. As long as the components are installed in the components directory of the project and conform to the components/component name/component name.vue directory structure. You can use it directly on the page without import or registering. as follows:
<template>
<view class="container">
<uni-list>
<uni-list-item title="one"></uni-list-item>
<uni-list-item title="two"></uni-list-item>
</uni-list>
</view>
</template>
<script>
// No need to import here, nor need to register in components
export default {
data() {
return {
}
}
}
</script>
No matter how many components are installed in the components directory, easycom will automatically remove unused components after packaging, which is particularly friendly to the use of component libraries.
like https://uniapp.dcloud.io/collocation/pages?id=easycom
Traditional vue components need to be installed, referenced, and registered, and the components can be used after three steps. easycom reduced it to one step. As long as the components are installed in the components directory of the project and conform to the
components/component name/component name.vue
directory structure. You can use it directly on the page without import or registering. as follows:No matter how many components are installed in the components directory,
easycom
will automatically remove unused components after packaging, which is particularly friendly to the use of component libraries.