前端增加插件化示例

This commit is contained in:
piexlmax
2022-06-19 13:02:12 +08:00
parent b6e2cf645b
commit e40d785e4e
10 changed files with 147 additions and 17 deletions
+16 -1
View File
@@ -1,6 +1,8 @@
<template>
<div
class="warning-bar"
:class="href&&'can-click'"
@click="open"
>
<el-icon>
<warning-filled />
@@ -12,12 +14,22 @@
</template>
<script setup>
import { WarningFilled } from '@element-plus/icons-vue'
defineProps({
const prop = defineProps({
title: {
type: String,
default: ''
},
href: {
type: String,
default: ''
}
})
const open = () => {
if (prop.href) {
window.open(prop.href)
}
}
</script>
<style lang="scss" scoped>
.warning-bar{
@@ -38,4 +50,7 @@ defineProps({
margin-left: 8px;
}
}
.can-click{
cursor: pointer;
}
</style>