VUE基本使用

//创建前调用this.currDate_fun()方法
created:function(){
            this.currDate_fun();
        },
mounted:function () {

},
  watch:{
            //出勤checkbox 出勤值 检查,一个为真,另外一个设置为false
            //tmp为singleIn_data的值变化
            singleIn_data:function (tmp) {
                if(tmp){
                    this.singleOut_data=false;
                }
                else{
                    this.singleIn_data=false;
                    this.singleOut_data=true;
                }
            },

            //出勤checkbox 请假值 检查,一个为真,另外一个设置为false
            singleOut_data:function (tmp) {
                if(tmp){
                    this.singleIn_data=false;
                }
                else{
                    this.singleIn_data=true;
                    this.singleOut_data=false;
                }
            }
  },

1、HTML页面调用,Username为Vue模板的data数据

//HTML
规格:{{Username}}

//vue JS
 data :{
            Username:''
        },

2、绑定

<div v-model.trim="Username">
//currDate_data为data里的数据
<mu-list-item :title="'出勤日期:'+(currDate_data) +  '填报人员:TT'"></mu-list-item>
//
 data :{
            currDate_data:''
        },

3、

<div v-if="username==='T1'">

4、

this.tmp = (val==='')?'A':'B'

5、在标签上循环输出,list为data里的数组

 <template v-for="(item, index) in userList_data">
<template v-for="item in list">
      <mu-list-item :title="item"/>
      <mu-divider/>
</template>
//vue JS
 data :{
            list:['item1','item2','item3','item4','item5','item6']
 },
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值