nuxt 구성 요소 와 공공 스타일 을 도입 하 는 작업
components 디 렉 터 리 에 구성 요 소 를 만 들 고 페이지 에 구성 요 소 를 도입 합 니 다.
예 를 들 어 공공 탐색 표시 줄 도입
구성 요소 생 성 components/Nav.vue

구성 요소 레이아웃/default.vue 도입

2,공공 양식 도입
assets/css/common.css
nuxt.config.js 에 도입

less 또는 sas 를 도입 하면:

보충 지식:nuxt 프로젝트 에서 component 구성 요 소 를 사용 합 니 다.
구성 요소 페이지 작성
1.components 아래 새 구성 요소 페이지 를 만 듭 니 다.다음 과 같 습 니 다.

2.새로 만 든 후 초기 페이지 의 코드 는 다음 과 같다.

3.element-ui 에서 상단 네 비게 이 션 메뉴 를 찾 아 구성 요소 페이지 에 쓰 십시오.
<el-menu
:default-active="activeIndex2"
class="el-menu-demo"
mode="horizontal"
@select="handleSelect"
background-color="#545c64"
text-color="#fff"
active-text-color="#ffd04b">
<el-menu-item index="1"> </el-menu-item>
<el-submenu index="2">
<template slot="title"> </template>
<el-menu-item index="2-1"> 1</el-menu-item>
<el-menu-item index="2-2"> 2</el-menu-item>
<el-menu-item index="2-3"> 3</el-menu-item>
<el-submenu index="2-4">
<template slot="title"> 4</template>
<el-menu-item index="2-4-1"> 1</el-menu-item>
<el-menu-item index="2-4-2"> 2</el-menu-item>
<el-menu-item index="2-4-3"> 3</el-menu-item>
</el-submenu>
</el-submenu>
<el-menu-item index="3" disabled> </el-menu-item>
<el-menu-item index="4"><a href="https://www.ele.me" rel="external nofollow" target="_blank"> </a></el-menu-item>
</el-menu>

구성 요소 사용
1.구성 요소 도입
import MinorTopMenu from '~/components/MinorTopMenu.vue'
2.구성 요소 등록
components: {
MinorTopMenu
}
3.구성 요소 사용4.페이지 코드 캡 처

테스트
페이지 를 엽 니 다.다음 과 같이 구성 요소 가 성공 적 으로 사용 되 었 음 을 설명 합 니 다.

이상 의 nuxt 가 구성 요소 와 공공 스타일 을 도입 하 는 작업 은 바로 작은 편집 이 여러분 에 게 공유 하 는 모든 내용 입 니 다.여러분 께 참고 가 되 고 저 희 를 많이 사랑 해 주 셨 으 면 좋 겠 습 니 다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
【비공식】Notion을 CMS로 해 기사 일람을 취득해 보았다 【하지만 편리】최근에는 업무 위탁으로 디자인 회사에서 배우면서 일전을 벌 수 있는 생활을 하고 있습니다. 또 이 후 axios를 넣을지 묻는다고 생각하므로 잊지 않고 넣어 봅시다. 이번에는 create-nuxt-app라는 페이지를...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.