Answers for "how to pass yaml data to vue file"

0

how to pass yaml data to vue file

// .vue file
// must have yaml-loader installed as a dependency
// place folowing block between <script></script>

import AppConfig from "@/assets/config.yaml"; // gets data from yaml config

export default {
  name: "HelloWorld",
  props: {
    msg: String,
  },
  data() {
    return {
      // can use moustaches or v-bind to dynamically inject data in template
      url: AppConfig.author["name"],
      repo: AppConfig.repo,
    };
  },
};
Posted by: Guest on January-12-2021

Code answers related to "how to pass yaml data to vue file"

Code answers related to "Javascript"

Browse Popular Code Answers by Language