-
-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: + 新增消息提示 + 修复火狐底部版本不显示的BUG + 优化eslint代码 + 增加文字识别错误提示 + 将原有弹出框修改…
…为消息提示 + 增加API:message
- Loading branch information
Showing
28 changed files
with
456 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { defineComponent, PropType, toRefs } from 'vue'; | ||
import { store } from '../main'; | ||
|
||
export interface AlertType { | ||
key: any; | ||
type: 'info' | 'success' | 'warn' | 'error'; | ||
text: string | ||
} | ||
|
||
export const Alert = defineComponent({ | ||
props: { | ||
type: { | ||
default: 'info', | ||
type: String as PropType<AlertType['type']> | ||
}, | ||
text: { | ||
default: '', | ||
type: String as PropType<string> | ||
}, | ||
index: { | ||
default: 0, | ||
type: Number as PropType<number> | ||
} | ||
}, | ||
setup(props) { | ||
const { type, text, index } = toRefs(props); | ||
|
||
return () => ( | ||
<div class={['alert', type.value].join(' ')}> | ||
<span >{ type.value === 'info' ? 'ℹ️' : type.value === 'error' ? '❗' : type.value === 'success' ? '✅' : type.value === 'warn' ? '⚠️' : '❕' }</span> | ||
<div style="display: inline"> | ||
<span | ||
class="alert-closer" | ||
onClick={() => (store.alerts.splice(index.value, 1))}> | ||
× | ||
</span> | ||
<span class="alert-text">{ text.value }</span> | ||
|
||
</div> | ||
</div> | ||
); | ||
} | ||
}); |
Oops, something went wrong.