Home >Web Front-end >JS Tutorial >How to publish vue components to npm
Let me explain to you the simple method and step process of publishing vue components to npm. Friends who need it can learn and refer to it together.
1.0 Create a new project
1.1 Initialize the project
Enter npm init, and then fill in whatever you need
Create a new src directory, and create a new alert in the src directory. vue
$ npm init $ mkdir src $ cd src $ touch alert.vue
Final directory structure
<template> <p class="alert"> <p>dddddd</p> </p> </template> <style> .alert { color: red; } </style> <script> export default { name:'vue-x-alert' } </script>2.0 Register npmOpen npm official website, register, and remember the registered account and password, npm-url2.1 Log in to npm and publish
$ npm login // 登录 $ npm publish
How to implement a drop-down menu in jQuery
How to use route parameter passing in vue
How to use two-way binding in AngularJs
How to implement the breadcrumb navigation function
The above is the detailed content of How to publish vue components to npm. For more information, please follow other related articles on the PHP Chinese website!