How to embed font to all page with nuxt js

后端 未结 5 1837
心在旅途
心在旅途 2021-01-04 12:51

I just embed google font to the global setting in nuxt.config.js

 link: [
      { rel: \'stylesheet\', href: \'https://fonts.googleapis.com/css?family=Roboto         


        
5条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-04 13:04

    Update your CSS with the following rule:

    body {
      font-family: 'Roboto', sans-serif;
    }
    

    If you don't have CSS stylesheet setup yet, create a new file in assets directory named i.e. main.css. Inside it put the code above and save it. Then edit nuxt.config.js adding this piece of code after head object:

    css: [
      '@/assets/main.css'
    ],
    

提交回复
热议问题