naive-ui/demo/components/messageDemo.vue
2019-06-19 17:43:57 +08:00

53 lines
911 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div
ref="doc"
class="doc"
>
<h1>Message</h1>
<hr>
<h2>基本用法</h2>
<button @click="emitMessage">
爱你那么用力却好像一场闹剧
</button>
<br><br>
<textarea rows="5"><button @click="emitMessage">
爱你那么用力却好像一场闹剧
</button>
<script>
emitMessage () {
this.$NMessage.error('Oops, here is a error')
this.$NMessage.success('Cloned Successfully')
}
</script>
</textarea>
<hr>
</div>
</template>
<script>
import docCodeEditorMixin from './docCodeEditorMixin'
export default {
mixins: [docCodeEditorMixin],
methods: {
emitMessage () {
this.$NMessage.error('Oops, here is a error')
this.$NMessage.success('Cloned Successfully')
}
}
}
</script>
<style scoped lang="scss">
.doc {
width: 900px;
margin: auto;
textarea {
width: 100%;
min-height: 3em;
}
}
</style>