2020-12-08 18:20:35 +08:00
|
|
|
<template>
|
2020-12-13 22:46:41 +08:00
|
|
|
<el-row>
|
|
|
|
<el-button>默认按钮</el-button>
|
|
|
|
<el-button type="primary">主要按钮</el-button>
|
|
|
|
<el-button type="success">成功按钮</el-button>
|
|
|
|
<el-button type="info">信息按钮</el-button>
|
|
|
|
<el-button type="warning">警告按钮</el-button>
|
|
|
|
<el-button type="danger">危险按钮</el-button>
|
|
|
|
</el-row>
|
|
|
|
<div class="aa">
|
|
|
|
22
|
|
|
|
<div class="bb">33</div>
|
|
|
|
<div class="red">44</div>
|
|
|
|
</div>
|
|
|
|
<el-color-picker v-model="color" @change="colorChange"></el-color-picker>
|
2020-12-16 18:25:59 +08:00
|
|
|
<img src="/@/assets/11.png" />
|
2020-12-08 18:20:35 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-12-13 22:46:41 +08:00
|
|
|
import { reactive, toRefs } from "vue";
|
2020-12-08 18:20:35 +08:00
|
|
|
export default {
|
|
|
|
name: "App",
|
2020-12-13 22:46:41 +08:00
|
|
|
setup() {
|
|
|
|
const state = reactive({
|
2020-12-15 17:48:55 +08:00
|
|
|
color: ""
|
2020-12-13 22:46:41 +08:00
|
|
|
});
|
|
|
|
function colorChange() {
|
|
|
|
console.log(state.color);
|
|
|
|
document
|
|
|
|
.getElementsByTagName("body")[0]
|
|
|
|
.style.setProperty("--primary", state.color);
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
colorChange,
|
|
|
|
...toRefs(state),
|
|
|
|
};
|
2020-12-08 18:20:35 +08:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
2020-12-13 22:46:41 +08:00
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
.aa {
|
|
|
|
border: 1px solid red;
|
|
|
|
.bb {
|
|
|
|
color: blue;
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|