8 changed files with 126 additions and 77 deletions
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.3 KiB |
@ -0,0 +1,90 @@ |
|||
<template> |
|||
<div class="prompt-text" :class="typeClass"> |
|||
<img class="prompt-icon" :src="typeIcon" alt=""> |
|||
<span class="prompt-desc">{{text}}</span> |
|||
</div> |
|||
</template> |
|||
<script> |
|||
|
|||
export default { |
|||
name: 'PromptText', |
|||
props: { |
|||
text: { |
|||
type: String, |
|||
required: true |
|||
}, |
|||
type: { |
|||
type: [Number, String], |
|||
default: 2 |
|||
}, |
|||
}, |
|||
components: { |
|||
}, |
|||
data(){ |
|||
return{} |
|||
}, |
|||
computed: { |
|||
typeClass() { |
|||
switch (parseInt(this.type)) { |
|||
case 1: return 'info'; |
|||
case 2: return 'notice'; |
|||
case 3: return 'warning'; |
|||
default: return 'notice'; |
|||
} |
|||
}, |
|||
typeIcon() { |
|||
switch (parseInt(this.type)) { |
|||
case 1: return require('@/assets/site/prompt-icon-1.svg'); |
|||
case 2: return require('@/assets/site/prompt-icon-2.svg'); |
|||
case 3: return require('@/assets/site/prompt-icon-3.svg'); |
|||
default: return require('@/assets/site/prompt-icon-2.svg'); |
|||
} |
|||
} |
|||
}, |
|||
methods:{ |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
<style scoped lang="scss"> |
|||
.info{ |
|||
display: flex; |
|||
align-items: center; |
|||
padding: 8px 13px; |
|||
align-self: stretch; |
|||
z-index: 1; |
|||
border-radius: 4px; |
|||
background: #F2F7FF; |
|||
border: 1px solid #BFDAFF; |
|||
} |
|||
.notice{ |
|||
display: flex; |
|||
align-items: center; |
|||
padding: 8px 13px; |
|||
align-self: stretch; |
|||
z-index: 1; |
|||
border-radius: 4px; |
|||
background: #FEFCE8; |
|||
border: 1px solid rgba(255, 140, 0, 0.3); |
|||
} |
|||
.warning{ |
|||
display: flex; |
|||
align-items: center; |
|||
padding: 8px 13px; |
|||
align-self: stretch; |
|||
z-index: 1; |
|||
border-radius: 4px; |
|||
background: #FFF1F0; |
|||
border: 1px solid #FFA39E; |
|||
} |
|||
.prompt-icon{ |
|||
width: 16px; |
|||
height: 16px;; |
|||
margin-right: 8px; |
|||
} |
|||
|
|||
.prompt-desc{ |
|||
color: #1E2226; |
|||
letter-spacing: 0.08em; |
|||
} |
|||
</style> |
Loading…
Reference in new issue