- mounted: function() {
- // Method to replace diagrams in loaded HTML
- const replaceByDiag = (match, p1, p2) => {
- const args = this.parseFen(p2);
- return getDiagram(args);
- };
- // (AJAX) Request to get rules content (plain text, HTML)
- this.content =
- require("raw-loader!pug-plain-loader!@/rules/" +
- this.$route.params["vname"] + "/" + this.st.lang + ".pug")
- .replace(/(fen:)([^:]*):/g, replaceByDiag);
+ created: async function() {
+ // NOTE: variant cannot be set before store is initialized
+ this.tryChangeVariant(this.$route.params["vname"]);