Last active
November 30, 2017 18:32
-
-
Save naeluh/a03b452400294d7ef7b3c34c647dcc52 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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