vue调色板

<template>
  <div id="app">
	<h1>调色板</h1>
    <div class="box" :style='{background:`rgb(${r},${g},${b})`}'></div>
    <div>r: <input type="range" min="0" max="255" v-model='r'></div>
    <span v-text='r'></span>
    <div>g: <input type="range" min="0" max="255" v-model='g'></div>
    <span v-text='g'></span>
    <div>b: <input type="range" min="0" max="255" v-model='b'></div>
    <span v-text='b'></span>
  </div>
</template>

<script>
  import HelloWorld from "./components/HelloWorld.vue"
  export default{
    components:{
        HelloWorld
    },
    data(){
      return{
        r:0,
        g:0,
        b:0
      }
    }
  }
</script>

<style>
.box{
  width: 100px;
  height: 100px;
  border: 1px solid red;
}
</style>

在这里插入图片描述