The first parameter of the export default { install(Vue,option){ Component directive mixin mount vue prototype } } 1. Globally registered componentsimport PageTools from '@/components/PageTools/pageTools.vue' import update from './update/index.vue' import ImageUpload from './ImageUpload/ImageUpload.vue' import ScreenFull from './ScreenFull' import ThemePicker from './ThemePicker' import TagsView from './TagsView' export default { install(Vue) { Vue.component('PageTools', PageTools) Vue.component('update', update) Vue.component('ImageUpload', ImageUpload) Vue.component('ScreenFull', ScreenFull) Vue.component('ThemePicker', ThemePicker) Vue.component('TagsView', TagsView) } } In main.js, directly use reference and Vue.use to register import Component from '@/components' Vue.use(Component) 2. Global custom instructionsexport default{ install(Vue){ Vue.directive('pre',{ inserted(button,bind){ button.addEventListener('click',()=>{ if(!button.disabled){ button.disabled = true; setTimeout(()=>{ button.disabled = false },1000) } }) } }) } } In main.js, just like registering components import pre from '@/aiqi' Vue.use(pre) This is the end of this article about the install method in vue. For more relevant content about the install method in vue, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Linux Samba server super detailed installation and configuration (with problem solving)
Table of contents 1. Unzip 2. Create a data folde...
01. Command Overview The seq command is used to g...
Table of contents Throttling and anti-shake conce...
I have encountered many problems in learning Dock...
Table of contents The first step is to download M...
Some special characters and icons used in the pro...
1. Introduction The previous program architecture...
I wrote some Qt interface programs, but found it ...
A dynamic clock demo based on Canvas is provided ...
I came into contact with CSS a long time ago, but...
1. Download from official website: https://dev.my...
As a required course for front-end developers, CS...
How much do you know about HTML? If you are learni...
<br />Hello everyone! It’s my honor to chat ...
Preface Recently, many new colleagues have asked ...