Skip to content

Instantly share code, notes, and snippets.

@panoply
Created January 18, 2018 14:42
Show Gist options
  • Save panoply/d823dd4e67d19cbf51bdfe44a387fbaa to your computer and use it in GitHub Desktop.
Save panoply/d823dd4e67d19cbf51bdfe44a387fbaa to your computer and use it in GitHub Desktop.
class Example {
fn(){
const root = document.querySelector('#locale')
const component = {
view(vnode){
return m(".ul.dash", [
m('li.shipping', [
m("span.float-none float-md-left pr-2", "Shipping:"),
m("button.shipping__button", {
style: {
width: "40px",
backgroundImage: "url("+store.get('locale').flag_path+")",
},
onclick: () => modal.open('#modal-shipping')
}, store.get('locale').code)
]),
m('li.currency', [
m("span.float-none float-md-left pr-2", "Currency"),
m('button.button__currency--open[type="button"]', [
m("span", store.get('locale').currency)
])
])
])
}
}
m.mount(root, component)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment