Sign in

How does the colorpicker of elementui preview the color modification effect of a page in real time?

Maverick edited in Mon, 21 Nov 2022

For example, users modify the color of the web page, click the color version, and the web page will change the color in real time. But the user does not click OK, when the color palette defocus automatically closes, the color of the page should be restored to the previous. Click OK to keep the color of the page, and then save it to the background.


2 Replies
commented on Mon, 21 Nov 2022

Change the following function to this:

displayedColor: function displayedColor(val) {
        this.$emit('active-change', val);
commented on Mon, 21 Nov 2022

I see what you mean. I just want to add a callback method when I hide the panel. Please refer to the following figure: Usage: @ cancel

<el-color-picker v-model="color" @cancel="cancelFn">