Web components, how to separate HTML from code

后端 未结 2 500
情歌与酒
情歌与酒 2021-01-26 18:06

I would like to know if it is possible (I am using ES6 and Typescript) to separate my HTML code from my components i.e. include the HTML code into a variable from another file.<

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-26 18:22

    I created a tool to allow you to write your HTML as regular files and allow you, if you want it, to create translations that can be incorporated into each component.

    It uses rollup to generate a compiled file that includes your JS, HTML, CSS and language info.

    https://www.npmjs.com/package/component-build-tools

    I am working on an upgrade that makes it simpler and does not require the combining of the files into one. I will adjust this answer once that is done.

提交回复
热议问题