Home  >  Article  >  Web Front-end  >  How to configure keyboard events globally in vue

How to configure keyboard events globally in vue

php中世界最好的语言
php中世界最好的语言Original
2018-02-24 09:33:293378browse

This time I will show you how vue configures the keyboard globally Events, what are the precautions for vue global configuration keyboard events, the following is a practical case, let's take a look.

Configure in main.js Vue.config.keyCodes.f1 = 112

Then you can @keyup.f12='demo' on the page

demo(){  console.log('demo')}

I believe after reading these You have mastered the case method. For more exciting information, please pay attention to other related articles on the PHP Chinese website!

Related reading:

Two methods to implement waterfall flow layout

About block-level format in CSS

Summary of the box model in HTML

What is the importance of overflow scrolling

What are the functions of html semantics

What are the usage methods of the cssText method of the style object

The above is the detailed content of How to configure keyboard events globally in vue. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn