mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-15 18:01:24 +08:00
32 lines
635 B
Vue
32 lines
635 B
Vue
|
<template>
|
||
|
<el-button :plain="true" @click="open">Show message</el-button>
|
||
|
<el-button :plain="true" @click="openVn">VNode</el-button>
|
||
|
</template>
|
||
|
|
||
|
<script lang="ts">
|
||
|
import { defineComponent, h } from 'vue'
|
||
|
import { ElMessage } from 'element-plus'
|
||
|
|
||
|
export default defineComponent({
|
||
|
setup() {
|
||
|
const open = () => {
|
||
|
ElMessage('this is a message.')
|
||
|
}
|
||
|
|
||
|
const openVn = () => {
|
||
|
ElMessage({
|
||
|
message: h('p', null, [
|
||
|
h('span', null, 'Message can be '),
|
||
|
h('i', { style: 'color: teal' }, 'VNode'),
|
||
|
]),
|
||
|
})
|
||
|
}
|
||
|
|
||
|
return {
|
||
|
open,
|
||
|
openVn,
|
||
|
}
|
||
|
},
|
||
|
})
|
||
|
</script>
|