About html component reuse

problem description


the environmental background of the problems and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)

what result do you expect? What is the error message actually seen?

Jul.06,2021

you can write a separate header, and package it into pages using gulp.


1. You just iframe go in
2. Let the backend cover the template for you
3. Generate vue project


with vue-cli
  1. html can be imported through < link rel= "import" href= "myfile.html" >, but browsers may not intend to support it all;
  2. you can use template engines such as Pug, ejs to support import, but you need to convert templates to standard html,. It's easy to do this through gulp.
  3. of course, you can also load code snippets through ajax, and insert them back into the corresponding position after loading.

recommend the way you use the template engine

Menu