пытался использовать https://element.eleme.io/#/en-US/component/message
в моем компоненте через
import Message from "@/components/ElementUi/Message";
и внутри этого компонента просто нормально включить из element-ui
<template>
<div>
<el-button :plain="true" @click="open">{{label}}</el-button>
</div>
</template>
<script>
import { Message, Button } from "element-ui";
// import lang from "element-ui/lib/locale/lang/ru-RU";
// import locale from "element-ui/lib/locale";
import "element-ui/lib/theme-chalk/index.css";
import "../../../public/css/element-variables.scss";
//locale.use(lang);
import Vue from "vue";
Vue.use(Message);
Vue.use(Button);
export default {
props: ["label", "content", "type", "duration", "run"],
data() {
return {};
},
methods: {
open() {
Message({
showClose: true,
message: this.content,
type: this.type,
duration: this.duration,
dangerouslyUseHTMLString: true
});
}
},
created() {
if (this.run == 1) {
// this.open();
}
},
beforeCreate() {}
};
</script>
Что происходит, когда мой компонент обновляет это раздражающее сообщение, автоматически отображающее 0 содержимого, но я хочу, чтобы оно отображалось только при выполнении некоторых условий
как
<div
v-if="searchCompleted.status && searchCompleted.codingType=='reverse' && searchCompleted.fullMatch == false "
>
<message
:duration="3000"
:label="'info'"
:content="'<p>No data</p>'"
:type="'message'"
></message>
</div>
</div>
В документации отсутствует информация о том, как не показывать элемент при начальном рендеринге компонента, поэтому должна быть какая-то чистая опция javascript, как отключить эту вещь и включить при необходимости?