Refer to the website
Link: vue plug-in (mobile terminal) .
Link: vue plug-in library (PC terminal) .
Tip
Take the vue plug-in (mobile terminal) as an example:
the command to install the mini-ui library:
npm install --save mint-ui
To achieve on-demand packaging, you must also execute commands and modify the .babelrc file:
npm install --save-dev babel-plugin-component
Modify the .babelrc file to:
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": ["transform-vue-jsx", "transform-runtime", ["component", [
{
"libraryName": "mint-ui",
"style": true
}
]]]
}
As shown in the figure:
the code introduced in the html.js file to solve the mobile terminal click delay
<script src="https://as.alipayobjects.com/g/component/fastclick/1.0.6/fastclick.js"></script>
<script>
if ('addEventListener' in document) {
document.addEventListener('DOMContentLoaded', function() {
FastClick.attach(document.body);
}, false);
}
if(!window.Promise) {
document.writeln('<script + src="https://as.alipayobjects.com/g/component/es6-promise/3.2.2/es6-promise.min.js"'+'>'+'<'+'/'+'script>');
}
</script>