I originally used Message in Element UI, but the style did not match the project, and the design was given to a new UI. Now I want to write this message prompt as a component. How to implement this call Message.error('Interface request fail');
. Or it doesn’t have to be in this form, as long as it can be dynamically inserted into the DOM
PHPz2017-05-19 10:27:11
I have tried two methods
One: hang the component to the root component and bind the component's status information to vuex. Expose an interface in the prototype of vue to change the status of the component. That is, change vuex by calling dispatch Status thus causing the component status to change.
2. The component does not need to be mounted, but exposes an interface in the vue prototype. Whenever the interface is called, a vue instance is dynamically constructed and the Message component is used as its subcomponent
伊谢尔伦2017-05-19 10:27:11
You can write a pop-up component, reference vuex and set a variable globally. When ajax returns, the pop-up box will be displayed according to different states