Vue2 playground
How do I make an vue2 playground?
What is a vue2 playground? How do you make a vue2 playground? This script and codes were developed by Juan Carlos Jara on 15 September 2022, Thursday.
Vue2 playground - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>vue2 playground</title>
</head>
<body> <ul id="app"> <li v-for="(item, index) in keyBindings"> <div v-if="index === editIndex">Press new key, press ESC to cancel</div> {{item.keyCode}} - {{item.desc}} - {{index}} <button @click="editKey(index)">edit</button> </li> </ul> <script src='https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.8/vue.js'></script> <script src="js/index.js"></script>
</body>
</html>
Vue2 playground - Script Codes JS Codes
var keyBindings = [ { keyCode: 75, key: 'K', desc: 'Play or Pause', id: 'play' }, { keyCode: 76, key: 'L', desc: 'Rewind 10 seconds', id: 'left' }, { keyCode: 74, key: 'J', desc: 'Forward 10 seconds', id: 'right' }, { keyCode: 77, key: 'M', desc: 'Mute or Unmute', id: 'mute' }
];
new Vue({ el: '#app', data: { keyBindings: keyBindings, editIndex: -1, }, created: function () { document.addEventListener('keyup', this.handleKeyPressed); }, methods: { handleKeyPressed: function (e) { if (e.keyCode === 27) { return this.cancelEdit(); } this.updateKey(e.keyCode); }, updateKey: function (keyCode) { Vue.set( this.keyBindings, this.editIndex, Object.assign({}, this.keyBindings[this.editIndex], {keyCode: keyCode}) ); this.cancelEdit(); }, editKey: function (index) { this.editIndex = index; }, cancelEdit: function() { this.editIndex = -1; } }
})
Developer | Juan Carlos Jara |
Username | juancjara |
Uploaded | September 15, 2022 |
Rating | 3 |
Size | 1,903 Kb |
Views | 34,408 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Test css hide | 1,837 Kb |
Cat clickerv4 | 2,751 Kb |
Cat clickerv5 | 3,502 Kb |
Json to survey | 2,875 Kb |
TreeHouse sticky Header | 6,944 Kb |
Cat clickerv1 | 1,771 Kb |
Cat clickerv3 | 2,401 Kb |
A Pen by Juan Carlos Jara | 1,762 Kb |
Cat clickerv2 | 2,071 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Get third wednesday | Wojtek1150 | 2,691 Kb |
Roman Numerical Converter | Vhall_io | 2,102 Kb |
CSS Google Now | Jackmoran | 3,196 Kb |
Multiple jCarousel | Pafnuty | 2,461 Kb |
A Pen by Malith Hettiarachchi | MalZiiirA | 5,531 Kb |
Funny menu | AxeLVaisper | 4,671 Kb |
Emberjs Bootstrap Modal Carousel | Somethingkindawierd | 4,233 Kb |
A Pen by Jason Kinney | Jason-kinney | 1,980 Kb |
BabyStore | Pablo-Ai | 3,807 Kb |
Heartbeat | Apetrov | 2,079 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!