lit-vue
lit-vue copied to clipboard
Support functional templates
Current way:
const template = html`<div>{{ message }}</div>`
New syntax:
const template = vm => html`<div>${vm.message}</div>`
- [ ] interpolations, like
<span>${vm.message}</span> - [ ] prop values, like
@click=${vm.inc} - [ ] v-for, impossible, we can convert
.maptov-forbut that's JSX not Vue template.. - [ ] v-if v-else v-else-if, like
<div v-if=${vm.foo}></div>
Hi! What does it mean "functional templates" in current issue context? It's "Vue functional components (with FunctionalRenderContext)" or "Local inline template for current Vue component" ?
If it's the second variant - can be possible using something like this with TypeScript?
const template = (vm: Hello) => html`<div>${vm.message}</div>`
@Component
export default class Hello extends Vue {
message: string = 'Hello, world!';
render() {
return template(this);
}
}
@c01nd01r the second one, but that doesn't work for now, html`<div>{{ message }}</div>` returns undefined. I got an idea on how to implement this, but probably as 2.0