vue各种字符串拼接

写法有两种::title="`字符串${xx}`"   或   :title="'字符串' + xx"  都可以。其中,{}里面可以写js方法。如:

1、vue绑定值与字符串拼接:

 
               

2、js中的字符串拼接:

this.personList.forEach(item => {
          item.label = `${item.userName}(${item.account})`;
        });
this.$bus.$emit(`${this.activeName}-reload`, this.searchData);
switchStatus(row) {
      this.$Modal.confirm({
        title: '提示',
        content: `是否确认切换状态为${row.isDelete === 1 ? '否' : '是'}?`,
        onOk: () => {
          row.isDelete = row.isDelete === 0 ? 1 : 0;
        }
      });
    },

 

 

你可能感兴趣的:(VUE,js)