Open peteruithoven opened 4 years ago
This might be related to: https://github.com/nesterone/vue-vega/issues/33 ?
// HelloWorld.vue
<template>
<vega-lite :data="values" mark="bar" :encoding="encoding" />
</template>
<script>
import Vue from "vue";
import VueVega from "vue-vega";
Vue.use(VueVega);
export default {
name: "HelloWorld",
props: {
msg: String
},
data() {
return {
values: [
{ a: "A", b: 28 },
{ a: "B", b: 55 },
{ a: "C", b: 43 },
{ a: "D", b: 91 },
{ a: "E", b: 81 },
{ a: "F", b: 53 },
{ a: "G", b: 19 },
{ a: "H", b: 87 },
{ a: "I", b: 52 }
],
encoding: {
x: { field: "a", type: "ordinal" },
y: { field: "b", type: "quantitative" }
}
};
}
};
</script>
Including the compiler of course fixes it
// vue.config.js
module.exports = {
runtimeCompiler: true
};
Reference: https://cli.vuejs.org/config/#runtimecompiler More info: https://vuejs.org/v2/guide/installation.html#Runtime-Compiler-vs-Runtime-only
How to do this for VuePress: https://github.com/vuejs/vuepress/issues/402#issuecomment-388169056
Is this an issue with how vue-vega is packaged? Is there a way to update this library to avoid needing to add this to projects using this lib?
I've started a new project using the Vue cli, but when I install vue-vega and add a simple example I get this error:
Is there anything I can do? Maybe some additional Getting started step would be good?
I'd love to combine vue-vega with VuePress where you normally compile as much as possible beforehand.