mirror of
				https://github.com/pure-admin/vue-pure-admin.git
				synced 2025-11-03 13:44:47 +08:00 
			
		
		
		
	
							parent
							
								
									ccf3a6f917
								
							
						
					
					
						commit
						d83f28dbd3
					
				@ -64,7 +64,7 @@
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* 全局覆盖element-plus的el-dialog、el-drawer、el-message-box、el-notification组件右上角关闭图标和el-upload上传文件列表右侧关闭图标的样式,表现更鲜明 */
 | 
					/* 全局覆盖element-plus的el-tour、el-dialog、el-drawer、el-message-box、el-notification组件右上角关闭图标和el-upload上传文件列表右侧关闭图标的样式,表现更鲜明 */
 | 
				
			||||||
.el-dialog__headerbtn,
 | 
					.el-dialog__headerbtn,
 | 
				
			||||||
.el-message-box__headerbtn {
 | 
					.el-message-box__headerbtn {
 | 
				
			||||||
  &:hover {
 | 
					  &:hover {
 | 
				
			||||||
@ -75,6 +75,7 @@
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.el-icon {
 | 
					.el-icon {
 | 
				
			||||||
 | 
					  &.el-tour__close,
 | 
				
			||||||
  &.el-dialog__close,
 | 
					  &.el-dialog__close,
 | 
				
			||||||
  &.el-drawer__close,
 | 
					  &.el-drawer__close,
 | 
				
			||||||
  &.el-message-box__close,
 | 
					  &.el-message-box__close,
 | 
				
			||||||
 | 
				
			|||||||
@ -1,15 +1,20 @@
 | 
				
			|||||||
<script setup lang="ts">
 | 
					<script setup lang="ts">
 | 
				
			||||||
 | 
					import { ref } from "vue";
 | 
				
			||||||
import intro from "intro.js";
 | 
					import intro from "intro.js";
 | 
				
			||||||
import "intro.js/minified/introjs.min.css";
 | 
					import "intro.js/minified/introjs.min.css";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type GuideStep = {
 | 
				
			||||||
 | 
					  element: string | HTMLElement;
 | 
				
			||||||
 | 
					  title: string;
 | 
				
			||||||
 | 
					  intro: string;
 | 
				
			||||||
 | 
					  position: "left" | "right" | "top" | "bottom";
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
defineOptions({
 | 
					defineOptions({
 | 
				
			||||||
  name: "Guide"
 | 
					  name: "Guide"
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const onGuide = () => {
 | 
					const GUIDE_STEPS = [
 | 
				
			||||||
  intro()
 | 
					 | 
				
			||||||
    .setOptions({
 | 
					 | 
				
			||||||
      steps: [
 | 
					 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    element: document.querySelector(".sidebar-logo-container") as
 | 
					    element: document.querySelector(".sidebar-logo-container") as
 | 
				
			||||||
      | string
 | 
					      | string
 | 
				
			||||||
@ -19,17 +24,13 @@ const onGuide = () => {
 | 
				
			|||||||
    position: "left"
 | 
					    position: "left"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
          element: document.querySelector("#header-search") as
 | 
					    element: document.querySelector("#header-search") as string | HTMLElement,
 | 
				
			||||||
            | string
 | 
					 | 
				
			||||||
            | HTMLElement,
 | 
					 | 
				
			||||||
    title: "搜索菜单",
 | 
					    title: "搜索菜单",
 | 
				
			||||||
    intro: "您可以在这里搜索想要查看的菜单",
 | 
					    intro: "您可以在这里搜索想要查看的菜单",
 | 
				
			||||||
    position: "left"
 | 
					    position: "left"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
          element: document.querySelector("#header-notice") as
 | 
					    element: document.querySelector("#header-notice") as string | HTMLElement,
 | 
				
			||||||
            | string
 | 
					 | 
				
			||||||
            | HTMLElement,
 | 
					 | 
				
			||||||
    title: "消息通知",
 | 
					    title: "消息通知",
 | 
				
			||||||
    intro: "您可以在这里查看管理员发送的消息",
 | 
					    intro: "您可以在这里查看管理员发送的消息",
 | 
				
			||||||
    position: "left"
 | 
					    position: "left"
 | 
				
			||||||
@ -54,10 +55,21 @@ const onGuide = () => {
 | 
				
			|||||||
    intro: "这里是您访问过的页面的历史",
 | 
					    intro: "这里是您访问过的页面的历史",
 | 
				
			||||||
    position: "bottom"
 | 
					    position: "bottom"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
      ]
 | 
					] as Partial<GuideStep>[];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const tourOpen = ref(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const onGuide = () => {
 | 
				
			||||||
 | 
					  intro()
 | 
				
			||||||
 | 
					    .setOptions({
 | 
				
			||||||
 | 
					      steps: GUIDE_STEPS
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
    .start();
 | 
					    .start();
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const onTour = () => {
 | 
				
			||||||
 | 
					  tourOpen.value = true;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
@ -69,6 +81,18 @@ const onGuide = () => {
 | 
				
			|||||||
        </span>
 | 
					        </span>
 | 
				
			||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
    </template>
 | 
					    </template>
 | 
				
			||||||
    <el-button @click="onGuide"> 打开引导页 </el-button>
 | 
					    <el-button @click="onGuide"> 打开引导页 (intro.js) </el-button>
 | 
				
			||||||
 | 
					    <el-button @click="onTour"> 打开引导页 (el-tour) </el-button>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <el-tour v-model="tourOpen">
 | 
				
			||||||
 | 
					      <el-tour-step
 | 
				
			||||||
 | 
					        v-for="step in GUIDE_STEPS"
 | 
				
			||||||
 | 
					        :key="step.title"
 | 
				
			||||||
 | 
					        :target="() => step.element"
 | 
				
			||||||
 | 
					        :title="step.title"
 | 
				
			||||||
 | 
					        :description="step.intro"
 | 
				
			||||||
 | 
					        :placement="step.position"
 | 
				
			||||||
 | 
					      />
 | 
				
			||||||
 | 
					    </el-tour>
 | 
				
			||||||
  </el-card>
 | 
					  </el-card>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user