Skip to content

Instantly share code, notes, and snippets.

@naeluh
Last active November 30, 2017 18:32
Show Gist options
  • Save naeluh/a03b452400294d7ef7b3c34c647dcc52 to your computer and use it in GitHub Desktop.
Save naeluh/a03b452400294d7ef7b3c34c647dcc52 to your computer and use it in GitHub Desktop.
<script type="text/javascript">window.data = <%= @data.to_json %>;</script>
<aat-main inline-template :arr="window.data">
... other html and v-for and v-if ...
</aat-main>
//this works
const main = {
props: {
arr: {
default: function() {
if (window.data) {
return window.data
} else {
return {
}
}
},
type: Object
}
},
data() {return {}},
methods: {},
created() {},
mounted() {
console.log(window.data)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment