Tooltip for button in Vue Button component
27 Feb 20231 minute to read
Tooltip can be shown on Button hover and it can be achieved by setting title
attribute.
The following snippets illustrates how to show tooltip on Button hover.
<template>
<ejs-button id='button' isPrimary=true>Button</ejs-button>
</template>
<script>
import Vue from 'vue';
import { ButtonPlugin } from '@syncfusion/ej2-vue-buttons';
import { enableRipple } from '@syncfusion/ej2-base';
enableRipple(true);
Vue.use(ButtonPlugin);
export default {
mounted () {
document.getElementById('button').setAttribute('title', 'Primary Button');
}
}
</script>
<style>
@import '../node_modules/@syncfusion/ej2-base/styles/material.css';
@import '../node_modules/@syncfusion/ej2-buttons/styles/material.css';
button {
margin: 25px 5px 20px 20px;
}
</style>