<template>
<el-button :plain="true" @click="success">成功</el-button>
</template>
<script>
export default {
methods: {
success() {
this.$message({
message: '恭喜你,這是一條成功訊息',
type: 'success',
custiomClass:'zdylm'
});
}
</script>
//注意style上不要加上scped,否則可能會導致樣式設定無效,
//如有需要用scoped,可以用如下方法
<style>
//注意message組件ElementUI樣式中有min-width,所以需要加上!important才能生效,
//另外的屬性類似,大家可以自行在頁面上引入后查看
.zdylm{
min-width:20vw!important;
}
</style>
<style scoped>
//你要寫的css樣式...
</style>
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/382004.html
標籤:其他
上一篇:JavaScript——DOM
下一篇:vue實作購物車功能
