Home > front end >  Vue program introduced vant components as needed
Vue program introduced vant components as needed

Time:09-17

vue projects using vant component library


Vant component library website https://youzan.github.io/vant/#/zh-CN/quickstart


# by NPM install
 NPM I vant -s 


# plug-in installation
 NPM I Babel - plugin - import - D 


Add configuration style # then. Babelrc on-demand loaded
 {
"Plugins" : [
[" import ", {
"LibraryName" : "vant,"
"LibraryDirectory" : "es",
"Style" : true
}]
]
}



So that you can in the component on-demand introduced!

 

<script>
The import {Button} from 'vant'
Export the default {
Components: {
VanButton: Button,
}
}
</script>



This is the first time, write post, if there is mistake hope to correct, the subsequent will continue to update the vue vant other component is used in the mobile terminal project,

CodePudding user response:

Should write on a blog, post are commonly used to answer questions

CodePudding user response:

This is not the first time, through the introduction to this several days is CSDN ha ha ha
  • Related