atst/js/index.js
Patrick Smith 855857217f Set custom delimiters for Vue
Normally, in Vue.js, you could use `{{ variable }}` to render the value
of some variable. In our setup however, Jinja expects to handle the
`{{}}` as a template. This change allows us to use `!{ variable }` to
render the value in our Vue templates.
2018-08-13 11:28:41 -04:00

41 lines
929 B
JavaScript

import classes from '../styles/atat.scss'
import Vue from 'vue/dist/vue'
import optionsinput from './components/options_input'
import textinput from './components/text_input'
import DetailsOfUse from './components/forms/details_of_use'
const app = new Vue({
el: '#app-root',
components: {
optionsinput,
textinput,
DetailsOfUse,
},
methods: {
closeModal: function(name) {
this.modals[name] = false
},
openModal: function (name) {
this.modals[name] = true
}
},
data: function() {
return {
modals: {
styleguideModal: false,
pendingFinancialVerification: false,
pendingCCPOApproval: false,
}
}
},
mounted: function() {
const modalOpen = document.querySelector("#modalOpen");
if (modalOpen) {
const modal = modalOpen.getAttribute("data-modal");
this.modals[modal] = true;
}
},
delimiters: ['!{', '}']
})