1.vue模板
<template>
<div class="example" ref="example">
</div>
</template>
<script>
// import PopupTreeInput from "./PopupTreeInput.vue";
export default {
name: "example",
// import引入的组件需要注入到对象中才能使用PopupTreeInput
components: { },
props: [""],
data() {
// 这里存放数据
return {
input: "",
};
},
// 监听属性 类似于data概念
computed: {},
// 监控data中的数据变化
watch: {
test: {
deep: true, // deep: true // 可以深度检测到 test 对象的属性值的变化
handler(newV) {
this.test = newV;
},
},
},
// 生命周期 - 创建完成(可以访问当前this实例)
created() {},
// 生命周期 - 挂载完成(可以访问DOM元素)
mounted() {
},
// 方法集合
methods: {
},
};
</script>
<style lang='scss' scoped>
.example {
}
</style>
let s=JSON.parse(JSON.stringify({}))
2.大屏模板
<template>
<div class="shengjiauditProblems" style="height: 100%;width: 100%;">
<div style="height: 97%;width: 100%">
<!-- <Top></Top> -->
</div>
</div>
</template>
<script>
import Top from "./top/index.vue";
export default {
components: {Top,},
data() {
return {
nowTime: "",
};
},
// 监听属性 类似于data概念
computed: {},
// 监控data中的数据变化
watch: {
test: {
deep: true, // deep: true // 可以深度检测到 test 对象的属性值的变化
handler(newV) {
this.test = newV;
},
},
},
// 生命周期 - 创建完成(可以访问当前this实例)
created() {},
// 生命周期 - 挂载完成(可以访问DOM元素)
mounted() {},
// 方法集合
methods: {},
};
</script>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.shengjiauditProblems {
background: rgba(0, 28, 48, 1) !important;
}
</style>
<style lang='scss' scoped>
.shengjiauditProblems {
}
</style>
3.背景图片模板
background-image: url("../../../../../assets/portalImg/group9.png");
background-repeat: no-repeat;
background-size: 100% 100%;
background-position: center;
4.calc
calc((100% - 280px) * 2.82)
5.获取当前页面的URL
window.location.href
window.location.origin
6.先将对象转换成字符串,再将字符串转换成对象,更换地址
将对象赋值给另一个对象,直接赋值可能会更改原来得对象
let s=JSON.parse(JSON.stringify({}))
6.1
//this.selectList是数组
let newV={...this.selectList}
let para2 = JSON.parse(JSON.stringify({newV}));
var arr2 = Object.keys(para2.newV).map(function(i){return para2.newV[i]})
//arr2 是数组
arr2.forEach(item => {
delete item.status
})