saebekassebil / teoria

Javascript taught Music Theory
http://saebekassebil.github.io/teoria
MIT License
1.32k stars 115 forks source link

include in vue.js component: how? #128

Open edellaq opened 5 years ago

edellaq commented 5 years ago

I'm trying to use teoria within a Single Page Application I'm (re)writing using Vue.js... Any suggestion on how to proceed importing the various modules?

martijnmichel commented 5 years ago

Its very easy. Try it out on CodeSandbox!

<script>
import teoria from "teoria";
const note = teoria.note;
const int = teoria.interval;
export default {
  name: "HelloWorld",
  computed: {
    note() {
      return note("a4")
        .interval('m3')
        .chord('m#11').simple()
    }
  }
};
</script>