我使用Vue.js在键盘点击时播放mp3声音。即使每个mp3小于40 KB,每个请求在heroku上仍有95ms延迟。
当dom准备好而不是单击按钮时,有没有一种下载声音的方法?
let a = 'sound1.mp3',
b = 'sound2.mp3';
new Vue({
created() {
this.onKeyDown = this.onKeyDown.bind(this);
document.getElementById('btn-sound'
我使用一个带有<style>块的模板,出于的原因,该模板必须位于其div附近。
当我运行Vue.js时,它似乎删除了样式块,说.
- Templates should only be responsible for mapping the state to the UI.
Avoid placing tags with side-effects in your templates, such as <style>,
as they will not be parsed.
我能做什么?
var app = new Vue({
el: '
我试图用角和值构建一个制表符组件。当我更改组件的道具时,Vue尖叫(在控制台中抛出一个错误)。角度看上去没问题。
<tab [active]="true"></tab>
export class TabComponent implements OnInit {
@Input() name: string;
@Input() active = false;
ngOnInit() {
// Here I am mutatating an input property which is bad because,
// furt