The color has changed, but the data bgColor bound by v-model has not changed. What should I do?


< html lang= "en" >
< head >

<meta charset="utf-8">
<link href="colorpicker/bootstrap-colorpicker.min.css" rel="stylesheet">
<script src="vue.js"></script>

< / head >
< body >
< div class= "container" id= "app" >

<div id="mycp" class="input-group colorpicker-component">
    <input type="text" class="form-control" v-model="bgColor"/>
    <span class="input-group-addon"><i></i></span>
    {{bgColor}}
</div>

< / div >
< script src= "jquery-2.2.3.min.js" > < / script >
< script src= "colorpicker/bootstrap-colorpicker.js" > < / script >
< script >

$(function () {
    $("-sharpmycp").colorpicker({});
});
var vm = new Vue({
    el: "-sharpapp",
    data:{
        bgColor:"rgba(10,10,10,0.5)",
    }
})

< / script >
< / body >

clipboard.png
this is the final result

Mar.06,2021

The

update method needs to be called. You can use computed or watch to implement

.

the upper left corner is input,. When you change his value through js, the data data does not change. This is because you directly manipulated dom
clipboard.png

clipboard.png

clipboard.png


clipboard.png

.

is that the question you're talking about? Neither of them has changed

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35ceb-2bfd8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35ceb-2bfd8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?