Vue2 playground

Size
1,903 Kb
Views
34,408

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 Previews

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; } }
})
Vue2 playground - Script Codes
Vue2 playground - Script Codes
Home Page Home
Developer Juan Carlos Jara
Username juancjara
Uploaded September 15, 2022
Rating 3
Size 1,903 Kb
Views 34,408
Do you need developer help for Vue2 playground?

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!

Juan Carlos Jara (juancjara) Script Codes
Create amazing captions with AI!

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!