How to reference a css file in the vue script methods method

get the css file under the folder to the download method, how to introduce this, I will splice it into the html variable, download the file operation!

methods:{
        download(){            
            const template = this.$refs.resume.$el.innerHTML;            
            let html = `<!DOCTYPE html>
                        <html>
                        <head>
                            <meta charset="utf-8">
                            <meta name="viewport" content="width=device-width,initial-scale=1.0">
                            <title>X-Find</title>
                            <style>
                            </style>
                        </head>
                        <body>
                            <div class="resume_preview_page" style="margin:0 auto;width:1200px">
                            ${template}
                            </div>
                        </body>
                        </html>`
            writer("test.html", html, "utf-8")
        }
    }
Mar.31,2021

you may need an absolute path to this css, and then link introduces = in the head of html. =


did I write the writer you used file-writer?

your question is actually to say, I have a css, under the folder how to make a string, right?

if yes, you can use:

// css
const url = '' // cssCDN
fetch(url).then(res => res.text()).then(console.log)
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3646e-2b849.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3646e-2b849.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?