Want to take a look at our new docs? Our new docs are now in beta. Have fun!

외부 리소스

외부 리소스를 사용하려면?

글로벌 설정

nuxt.config.js 파일 안에 리소스를 include합니다:

module.exports = {
  head: {
    script: [
      {
        src: 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'
      }
    ],
    link: [
      {
        rel: 'stylesheet',
        href: 'https://fonts.googleapis.com/css?family=Roboto'
      }
    ]
  }
}

로컬 설정

pages 디렉토리의 .vue 파일 안에서 리소스를 include합니다:

<template>
  <h1>About page with jQuery and Roboto font</h1>
</template>

<script>
  export default {
    head: {
      script: [
        {
          src:
            'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'
        }
      ],
      link: [
        {
          rel: 'stylesheet',
          href: 'https://fonts.googleapis.com/css?family=Roboto'
        }
      ]
    }
  }
</script>
Contribution for this page is now closed. If you would like to contribute please check out our new docs are now in beta. Have fun!

Platinum Sponsors

StoryblokMoovweb Support Us