LoginSignup
1
0

More than 3 years have passed since last update.

おとをだすVue

Posted at

備忘録
取り急ぎ(エレメントの指定してる部分とか省略)

var watcher_vm = new Vue({
    el: '#wrapper',
    data: {
        // データ系他で使うとこあればここ
    },
    methods: {
        playSound: function() {
            let se = $('#btnsound');
            console.log(se);
            se[0].currentTime = 0;
            se[0].play();
    },
    <a id="link" v-on:click="playSound()">音声鳴らす</a>
    <audio id="linksound" preload="auto">
        <source src="{{asset('/ongaku.mp3')}}" type="audio/mp3">
    </audio>
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0