728x90
현상
vue.js의 컴포넌트에서 script나 style 태그를 사용한 뒤 실행하면 다음과 같은 오류가 발생합니다.
Internal server error: Tags with side effect (<script> and <style>) are ignored in client component templates.
해결방법
필요한 스크립트나 스타일을 전역으로 설정하면 되지만, 여기서는 다음 방법으로 컴포넌트내 삽입할 수 있습니다.
script를 component is="script" 로 변경하면 됩니다.
기존 스크립트
<script type="text/javascript" src="https://oofbird.me/test.js"/>
변경 스크립트
<component is="script" type="text/javascript" src="https://oofbird.me/test.js"/>
반응형
'Language' 카테고리의 다른 글
[Java] Queue 자료형 (0) | 2022.04.27 |
---|---|
[Python] Tensorflow로 사용가능한 GPU 확인하기 (0) | 2021.04.06 |
[Kotlin] IntelliJ에서 Kotlin 시작하기 (0) | 2019.05.11 |
[ReactJS] create-react-app의 실행 포트 변경 (1) | 2019.04.24 |
[highlight.js] 티스토리 신규 에디터에 소스코드 입력 (0) | 2019.04.19 |