对el-button按钮设置提示文本的方法
第一步:创建一个组件
第二步:写index.js文件的代码
<template>
<a :title="title" style="margin: 10px">
<el-button v-bind="$attrs" v-on="$listeners"></el-button>
</a>
</template>
<script>
export default {
name: "HintButton",
props: ["title"],
};
</script>
<style></style>
第三步:注册全局组件【在main.js中】
import HintButton from "@/components/HintButton/index";
Vue.component(HintButton.name, HintButton);
第四步:将页面的el-button改为hint-button-----加上title提示文本
<hint-button type="success" icon="el-icon-plus" size="mini" title="添加sku"></hint-button>