k-alert
コンポーネントはアラートとして使用されます。
デモ
使い方
<template>
<div class="components">
<k-alert text="アラート" type="error" :visible="visible" @close="onClose" />
<k-button text="error アラート表示" @click="showError" />
</div>
</template>
<script>
export default {
data() {
return {
visible: false
};
},
methods: {
showError() {
this.visible = true;
},
onClose() {
this.visible = false;
}
}
};
</script>
Attribute
Name | Description | Type | Required |
---|---|---|---|
text | アラートとして表示する文字列. デフォルト値: ‘’ |
String | Yes |
type | アラートのタイプ. ・success ・error デフォルト値: ‘error’ |
String | No |
visible | アラートを表示するかどうか. デフォルト値: true |
Boolean | No |
Event
Name | Description |
---|---|
close | ユーザーの操作によって閉じるボタンが押されたときに発生する。 |