Object.assign(properties, {userType: Object.keys(properties)[0],})
禁止事件传播
@dragging.stop.prevent
结构出返回值中的各种属性
.then(({ result: { menu,auth,isDefault } }) => {
<q-dialog v-model="edithandovermodal">
<q-card style="min-width: 500px;">
<q-toolbar>
<q-toolbar-title>重命名</q-toolbar-title>
<q-btn icon="close" flat round dense v-close-popup/>
</q-toolbar>
<q-card-section>
<q-input v-model="editItem.name" />
</q-card-section>
<q-card-actions align="right">
<q-btn label="确定" @click.stop="update(editItem, 'edit')" color="primary" dense />
<q-btn label="取消" v-close-popup color="negative" dense />
</q-card-actions>
</q-card>
</q-dialog>
var a = "1,3,2"
先转成数组:
let b = [...a]
console.log(b) //["1", ",", "3", ",", "2"]
list:['test','111']
let str3 = list.join(',') // 逗号分隔
console.info('str3', str3)
this.$refs.senddeptForm
<senddept ref="senddeptForm" :eventDeptList = "eventDeptList" :userSetting="userSetting"/>
给列表中的数据添加一个属性
querySysDept(pid = '0') {
this.loading = true;
return this.$axios.post('sys/querySysDept', { pid })
.then((r) => r.data.map((v) => ({
lazy: true,
...v,
}))).finally(() => {
this.loading = false;
});
},
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.b{
position: relative;
width: 400px;
height: 400px;
background: #f00;
margin:200px
}
.c1{
position: absolute;
left: 0;
top:-40px;
height: 40px;
width: 200px;
background: #00f;
}
.c2{
position: absolute;
left: -40px;
top:0px;
height: 100%;
width: 40px;
background: #0f0;
}
.c3{
position: absolute;
left: auto;
right:0;
top:-40px;
height: 40px;
width: 200px;
background: #0ff;
}
</style>
</head>
<body>
<div class="b">
<div class="c2"></div>
<div class="c3"></div>
<div class="c1"></div>
</div>
</body>
</html>
<script>
const l = [{
c:false,
}]
const l2=[{
s:[]
}]
showlist
const t={
get(){
return l.filter(v=>!v.c).length===0
},
set(v){
l.forEach(z=>z.c=v)
}
}
{
data(){
return {
cl:[{
cs:[]
}],
showlist:[]
}
},
methods:{
input(v){
this.showlist = v.cs;
}
}
}
</script>
Object.keys(d).forEach((key) => {
if (key.startsWith('AsText(')) {
const realkey = key.slice(7, key.length - 1);
d[realkey] = d[key].slice(6, d[key].length - 1).split(' ');
}
});
JSON.parse(dd.trim());
JSON.stringify(r.data);
this.$nextTick(() => {
const result = this.reductionParams(JSON.parse(a.data.payload.formConfig));
// console.log(result);
this.formData = {
...result,
list: result.list.filter((el) => !el.attr.notree),
};
this.filterItemByHeight(result.list);
this.getAllKey(result.list);
// console.log(this.formData);
});
@tap="btnTap" 父组件给子组件一个函数
this.$emit('tap', type); 子组件调用父组件
query() {
const { id } = this.$route.query;
return this.$axios_r.get(`cstForm/getFormInfo/${id}`);
},
async request() {
const a = await this.query();
}
<slot></slot>